Java中Math.round()

首先:它的返回值類型是long。 如果 Math.round(11.5f),那它的返回值類型就是int,這一點可以參考API。 其次 Returns the closest long to the argument, with ties rounding to positive infinity 它返回的是一個最接近參數的long 值 例如: Math.round(11.6) = 12 Math.
相關文章
相關標籤/搜索