my $n; $n += 0.1 for 1..10; # $n = 0.1 * 10 = 1 ...ish my $r = int($n*2)/2; print("round($n) = $r\n"); # round(1) = 0.5 print("cause it's really doing\n"); # cause it's really doing printf("round(%.16e)\n", $n); # round(9.9999999999999989e-001)