Round of floating values
This question already has an answer here:
You shouldn't be using binary floating point to handle monetary amounts. There are many issues having to do with rounding and the inexact nature of floating point. For example, you won't be able to exactly represent 0.1
as a float
.
Use fixed-point arithmetic instead.
链接地址: http://www.djcxy.com/p/85806.html上一篇: Java中的添加
下一篇: 一轮浮动值