Implement Perl's int() rounding