Nice try. But...

No. It isn't.

YOU are wrong! Wrong! Wrong!

It is just a consequence of switching between base 10 and 2:

#!/usr/bin/perl -wl use strict; for my $n ( 0.000005, 0.000015, 0.000025, 0.000035, 0.000045, 0.000055, 0.000065, 0.000075, 0.000085, 0.000095, ) { printf "%.23f\n", $n; } __END__ 0.00000500000000000000041 0.00001500000000000000038 0.00002500000000000000120 0.00003499999999999999693 0.00004500000000000000283 0.00005500000000000000196 0.00006499999999999999431 0.00007499999999999999343 0.00008500000000000000611 0.00009500000000000000523

Your assumption that 0.000035 is exactly the same as 0.000005 + 3*0.000010 was not correct.

Update: Please show the results for explicitly enumerated values and show more precision on the first value. Or I'll to do that myself a bit later when I will probably again have convenient access to a system with Inline::C installed on it and with _controlfp().

- tye        


In reply to Re^2: RFC: Large Floating Point Numbers - Rounding Errors (not Rounding mode) by tye
in thread RFC: Large Floating Point Numbers - Rounding Errors by GAVollink

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.