Oh look, I got the same answer. Also, Perl6's printf lies.> 3e-1 - Num(.3) 5.55111512312578e-17
But you can still get an honest printf with Inline::Perl5.> printf "%.100f\n", .3 0.30000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000 > printf "%.100f\n", 3e-1 0.30000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000 > printf "%.100f\n", Num(.3) 0.30000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000
use Inline::Perl5; my $p5 = Inline::Perl5.new; $p5.run('sub p { printf "%.100f\n", shift }'); $p5.call('p', .3); $p5.call('p', Num(.3)); $p5.call('p', 3e-1); =finish 0.29999999999999998889776975374843459576368331909179687500000000000000 +00000000000000000000000000000000 0.29999999999999998889776975374843459576368331909179687500000000000000 +00000000000000000000000000000000 0.30000000000000004440892098500626161694526672363281250000000000000000 +00000000000000000000000000000000
In reply to Re^7: Small Perl 6 discoveries II, Rats
by Anonymous Monk
in thread [Perl6] Small discoveries I, __DATA__
by holli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |