You might want to request that your build of Perl get a different number of digits declared as "worth worrying about". Your addition only removes a single digit from the magnitude of the numbers involved. That should not, IMHO, be enough to trigger the showing of such noise.

It would probably be better for your version of Perl to be built to consider 13 digits (or maybe 14) as worth reporting instead of 15.

It looks like modern C compilers define DBL_DIG and Perl defaults to using that when converting a double into a string. Standard "double" has 52 bits of mantissa which gives 15.65 digits of accuracy (not 15.95 like wikipedia seems to claim, including the sign bit in the calculation for unknown reasons). My C compiler defines 15 for DBL_DIG, which makes sense. But Perl should not be caring about so many digits. We need only about 1/2 of a digit of error for "9999999" or "0000001" noise to start showing up.

I would want at least 1.5 digits of slush before such noise results so I would hope that Perl would default to using DBL_DIG-1 (DBL_DIG-2 seems even better) not DBL_DIG (for NV_DIG when NV is a "double").

- tye        


In reply to Re: Bad math (tweak) by tye
in thread Bad math by elfpen

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.