Perl で、浮動小数点数の整数化 (小数点以下の切り捨て) をやる場合、 int() を常用していたけど、どうやら、これは基本的に推奨されてないということを、今更ながら知る。 これって常識? % perldoc -f int int EXPR int Returns the integer portion of EXPR. If EXPR is omitted, uses $_. You should not use this function for rounding: one because it truncates towards 0, and two because machine representations of floating point numbers can sometimes produce counterintu- itive results. For exam
![「切り捨て」に int() は使うべからず : にぽたん研究所](https://cdn-ak-scissors.b.st-hatena.com/image/square/da78a05937633f7a2b4b2219826151c370cd607b/height=288;version=1;width=512/https%3A%2F%2Fparts.blog.livedoor.jp%2Fimg%2Fusr%2Fcmn%2Fogp_image%2Flivedoor.png)