HAKASHUN / manabi

manabi
14 stars 1 forks source link

Mathのceil, round, floorをまとめとく #39

Open HAKASHUN opened 10 years ago

HAKASHUN commented 10 years ago

Math.ceil

引数として与えた数以上の最小の整数を返します。

引数 結果
45.95 46
-45.95 -45

Math.round

引数として与えた数を四捨五入して、最も近似の整数を返します。

引数 結果
45.95 46
-45.95 -46

Math.floor

引数として与えた数以下の最大の整数を返します。

引数 結果
45.95 45
-45.95 -46