perl -MPOSIX=ceil -e "$n=-2.1; print($n, ' POSIX: ', ceil($n))" # -2.1 POSIX: -2 perl -e "$n=-2.1; print($n, ' other: ', int($n) + ($n != int($n)))" # -2.1 other: -1
In reply to Re^3: how to always round up in perl?
by sbohning
in thread how to always round up in perl?
by cburger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |