Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^4: Detecting whether UV fits into an NV

by syphilis (Bishop)
on Feb 27, 2020 at 10:42 UTC ( #11113477=note: print w/replies, xml ) Need Help??

in reply to Re^3: Detecting whether UV fits into an NV
in thread Detecting whether UV fits into an NV

Cool - and thanks for going to the trouble of providing that. (I can spend hours trying to get pack and unpack to do what I want them to do ;-)
Both of your approaches still fail to deal correctly with certain values when older Microsoft compilers are used.
All is good for the value of 18014398509481985, irrespective of compiler. The value of $x changes from 18014398509481985 to 18014398509481984, indicating correctly that 18014398509481985 is not representable as a double.

However, IIUC, the value of $x should not alter if $x is initialized to (eg) 18446744073709549568 or 18446744073709139968 as both values are representable as a double.
But those values do change with those older Microsoft compilers - again, I believe, indicative of that same problem (that I keep hitting) that afflicted Microsoft compilers until some point after Visual Studio 2010 and no later than Visual Studio 2017.

At this point, the only thing that's working on these troublesome Microsoft compilers are the subs I provided in my initial post.

I should point out that I haven't yet got to assessing jcb's contribution. I'll try to get to it over the weekend, or whenever I can find the time.

  • Comment on Re^4: Detecting whether UV fits into an NV

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11113477]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2020-11-30 22:59 GMT
Find Nodes?
    Voting Booth?

    No recent polls found