Java中Math.round()

以参数为double 类型为例 首先要注意的是它的返回值类型是long,如果 Math.round(11.5f),那它的返回值类型就是int,这一点可以参考API 其次 Returns the closest long to the argument, with ties rounding to positive infinity 它返回的是一个最接近参数的long 值(例如:Math.round
相关文章
相关标签/搜索