JavaScript

Math.floor()メソッド

 編集:2022.08.07 by T.A.

Math.floor(x)
x 数値です。
戻り値

指定された数値以下の最大の整数を表す数値です。

解説

¶省く

Math.floor() の使用
D=Math.floor( 45.95);	//=45
D=Math.floor( 45.05);	//=45
D=Math.floor(  4   );	//=4
D=Math.floor(-45.05);	//=-46
D=Math.floor(-45.95);	//=-46

テスト