Es6-math-floor

提供:Dev Guides
2020年6月23日 (火) 08:04時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

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