top | item 10559211

(no title)

bmn_ | 10 years ago

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

discuss

order

No comments yet.