Math.floor
数値の繰り下げ
構文
Math.floor(x)
引数
x=数値例文
<html> <head> <title>Math.floor</title> </head> <body> <!--数値の繰り下げのサンプル--> <script type="text/javascript"> document.write('0.60の切り下げ値は'+Math.floor(0.60)+"です<br>"); document.write('0.40の切り下げ値は'+Math.floor(0.40)+"です<br>"); document.write('5の切り下げ値は'+Math.floor(5)+"です<br>"); document.write('5.1の切り下げ値は'+Math.floor(5.1)+"です<br>"); document.write('-5.1の切り下げ値は'+Math.floor(-5.1)+"です<br>"); document.write('-5.9の切り下げ値は'+Math.floor(-5.9)+"です"); </script> </body> </html>
関連記事
- Math.tan
- Math.atan2
- Math.sqrt
- Math.sin
- Math.round
- Math.random
- Math.pow
- Math.min
- Math.max
- Math.log
- Math.exp
- Math.cos
- Math.ceil
- Math.atan
- Math.asin
- Math.acos
- Math.abs
- Math.SQRT2
- Math.SQRT1_2
- Math.PI
- Math.LOG2E
- Math.LOG10E
- Math.LN2
- Math.LN10
- Math.E
スポンサーリンク