in reply to Re: Behaviour of int() unexpected
in thread Behaviour of int() unexpected

Or use '%.0f' instead of '%d':

perl -Mstrict -wE'my $val = 8.95; printf("%.0f\n", 100*$val);'

Replies are listed 'Best First'.
Re^3: Behaviour of int() unexpected
by ikegami (Patriarch) on Mar 12, 2025 at 16:18 UTC

    That rounds rather than truncate.