Es6-math-floor

提供:Dev Guides
移動先:案内検索

ES6-Math floor()関数

xの下限:x以下の最大整数。

構文

Math.floor( x ) ;

パラメータ

  • X-数値を表します

console.log("---Math.floor()---")
console.log("Math.floor(2.8) : "+Math.floor(2.8))
console.log("Math.floor(-3.2) : "+Math.floor(-3.2))

出力

---Math.floor()---
Math.floor(2.8) : 2
Math.floor(-3.2) : -4