Comment

Comment by bmn_

Not 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
parent bmn_ 11 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton