I hate decimal numbers. For 1.005 I don\'t get the result I expect with the following code.
#!/usr/bin/perl -w use strict; use POSIX qw(floor); my $num = (
floor() is not for rounding, it goes down to the nearest integer.
floor()
See this old post: How do you round a floating point number in Perl?