Your diagnostics are still not telling you the whole of the story, because Devel::Peek is performing the same sort of rounding on the NV value it shows you that perl normally does.

If you want to look at these values in more detail, best to ask for it explicitly with sprintf:

my $a = 4253.95; my $b = 0.9; my $c = $a + $b; print "$a + $b = $c\n"; printf "%.30f + %.30f = %.30f\n", $a, $b, $c;

If you use this with your real code, it is more likely to show you the actual difference between the numbers you get when you enter them explicitly as above and those derived in your code. My guess would be accumulated rounding errors; another possibility would be something modifying $# (see perlvar), but trying to create a testcase to illustrate that I can't get it to do anything at all.

Hugo


In reply to Re^2: 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals) by hv
in thread 4253.95 + 0.9 = 4254.84999999999 (need help to interpret internals) by jplindstrom

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.