$i = 1.255 $j = $i * 100 + 0.5 $j = $j * 10000000 <p> print $j <p> -> 1260000000 <p> print int ( $j ) <p> -> 1259999999
Is there a way to make perl behave as a humble user of arithmetics would have expected, without needing additional modules like Math::Round?
In reply to How to use the int-function? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |