#! perl -sw use strict; use POSIX; my $n = 5.2; print $n, ' ', POSIX::ceil($n), ' ', POSIX::floor($n), $/; __DATA__ C:\test>203372 5.2 6 5 C:\test>