in reply to Rounding without int() or printf()

Rounding without mathematical operations will be far slower. Treating numbers like strings in order to round them is probably a dubious task. Use a mathematical approach:
# $rounded = round($value, $places); sub round { my ($N,$P) = @_; my $pm = $N > 0 ? 1 : -1; return int($N * 10**$P + .5 * $pm) / 10**$P; }


japhy -- Perl and Regex Hacker