Can I suggest that you dump each value to a file along with some natural identifier (line number or cell ID), using:

print unpack 'b64', pack 'd', $float;; 1011110110001011101100101110110101100111111000110111101000000011

Do this immediately after reading it into your script to ensure the minimum possibility of 'internal influences'. Then, when you encounter unexpected/unexplainable differences, dump both values in the same form, along with their original identifiers.

I can't offer an explanation for how or why what you are seeing could happen, but I have seen some weirdness in Perl's internal handling of floats in the past. Dumping bit patterns is surest way I know of inspecting what is actually there.

That said, you can still be fooled, as IEEE allow for the possibility of denormalised representations. That is, the bit patterns can be different but represent (exactly) the same values. Kind of like binary equivalent of 10e-6 vs. 1e-5.

Anyway, if you can track what differences are being perceived, then you may be able to backtrack to where they arise. And if you can do that, an explanation of why may be obvious or forthcoming.

Good luck.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^3: False positive on inequality comparison by BrowserUk
in thread False positive on inequality comparison by Nkuvu

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.