Always Round UP a Double

前端 未结 7 1686
温柔的废话
温柔的废话 2020-12-06 09:55

How could I always round up a double to an int, and never round it down. I know of Math.round(double), but I want it to always round u

7条回答
  •  独厮守ぢ
    2020-12-06 10:08

    Math.ceil() will give you the closest lowest value if you want it to be rounded to largest closest values you should use Math.floor()

提交回复
热议问题