2 ms·
Yep, it's better to print the result of 0.1+0.2-0.3
by Tepix 11y ago
Yep, it's better to print the result of 0.1+0.2-0.3
- bmn_ 11y agoNot generally! $ perl -E 'say sprintf "%.64f", 0.1 + 0.2' 0.3000000000000000000108420217248550443400745280086994171142578125 $ perl -E 'say sprintf "%.64f", 0.1 + 0.2 - 0.3' 0.0000000000000000000000000000000000000000000000000000000000000000 My Perl is configured with -Dusemorebits. https://metacpan.org/pod/distribution/perl/INSTALL#more-bits https://metacpan.org/pod/distribution/perl/INSTALL#more-bits