http://www.perlmonks.org?node_id=11137042


in reply to Re^3: Padding with sprintf changing number
in thread Padding with sprintf changing number

> Neither python3 nor raku

But

$ python2 -c 'print(4887.15 * 100)' 488715.0

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^5: Padding with sprintf changing number
by syphilis (Archbishop) on Sep 27, 2021 at 14:53 UTC
    Yes, I had good reason to avoid mentioning python2's print() implementation ;-)
    It apparently rounds to even fewer decimal digits than perl5:
    $ python2 -c 'print 2 ** 0.5' 1.41421356237 $ perl -le 'print 2 ** 0.5' 1.4142135623731
    At least they've done something about it.
    Maybe perl7 will do the same.

    Cheers,
    Rob