3 ms·
~> perl6 -e "say(0.1 + 0.2)" 0.3 ~> nqp -e "say(0.1 + 0.2)" 0.3 ~> perl6 -e "say (0.1 + 0.2).WHAT" (Rat) http://doc.perl6.org/type/Rat http://doc.perl6.or
by xaduha 11y ago
~> perl6 -e "say(0.1 + 0.2)"
0.3
~> nqp -e "say(0.1 + 0.2)"
0.3
~> perl6 -e "say (0.1 + 0.2).WHAT"
(Rat)
http://doc.perl6.org/type/Rat http://doc.perl6.org/type/Rat
- raiph 11y agoFrom the article: $ lua Lua 5.3.2 Copyright (C) 1994-2015 Lua.org, PUC-Rio > print(0.1 + 0.2) 0.3 (For completely different reasons. I think it's worth being explicit that NQP and Perl 6 get the right result because they are doing this calculation with exactly correct numbers and operations rather than "using printf() with a %.14g format string".)