切捨て

切捨て

floor(x) (ECMAScript 仕様書算法定義)

[1] ES3 仕様書中の算法の定義で用いられている数学関数 floor(x) は、x 以下で最大の整数を表します。

関連

[2] いわゆる「切捨て」にあたりますが、の値の場合小数点以下の値を無視するのではなく、 より小さな整数となります。

[3] Fix #39: use floor() rather than rely on integer division · whatwg/url@af76ff3 ( 版) <https://github.com/whatwg/url/commit/af76ff3aa15be6310b9408d416854c2370175a8f>

[4] Editorial: remove floor() operation in favor of integer division (annevk著, ) <https://github.com/whatwg/encoding/commit/eb8130688bcaafb75cefa519faa19141de30407e>