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>

関連記事

スポンサーリンク

GIF画像の特徴

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る