http://www.perlmonks.org?node_id=890147


in reply to how to always round up in perl?

Or if you do not want to import a mass of functions into your namespace from the POSIX module, just do this:

my $n = 3.3; my $ceiling = int($n + 1);

(Update) Above is incorrect, as pointed out by others. This works:

my $ceiling = ($n == int $n) ? $n : int($n + 1);