use POSIX 'floor'; sub round { my $x = shift; floor($x + 0.5); }