Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: 64-bit division anomolies (Solved.)

by syphilis (Archbishop)
on Feb 17, 2015 at 03:29 UTC ( [id://1116941]=note: print w/replies, xml ) Need Help??


in reply to 64-bit division anomolies (Solved.)

The latest I've tried this on is 5.18, so it might have been fixed in later builds

It hasn't been - and it goes back to at least 5.16, and it affects 32-bit perls in the same way for unsigned values greater than 2 ** 31.

I couldn't find a way to successfully perform integer division/modulation with these large unsigned values without resorting to XS (as you've done).
(Update: Obviously, I've ignored Math::BigInt.)
However, I'm sure the integer pragma is supposed to cater for this and I couldn't find anything in the docs to suggest otherwise.

So I've submitted a bug report against integer for this - in case there's someone who cares enough to fix it.
(I hit "Send" before thinking to reference the original PM post in that report ... sorry 'bout that.)

Cheers,
Rob
  • Comment on Re: 64-bit division anomolies (Solved.)

Replies are listed 'Best First'.
Re^2: 64-bit division anomolies (Solved.)
by syphilis (Archbishop) on Feb 17, 2015 at 09:41 UTC
    So I've submitted a bug report against integer for this - in case there's someone who cares enough to fix it.

    Turns out that the integer pragma only works with integer values in the range -(2**63) .. (2**63-1).
    On 32-bit perls that range becomes -(2**31) .. (2**31-1).
    Yes - it's that crappy, and I doubt that anyone cares.

    It's all there in the integer docs if one reads that documentation properly - which I didn't do.

    Wiping egg off face (... yet again),
    Rob
      But still the unnecessary conversion to float when dividing two unsigned integers looks like a bug to me.

      BTW, the multiplication is also affected.

Re^2: 64-bit division anomolies (Solved.)
by BrowserUk (Patriarch) on Feb 17, 2015 at 12:37 UTC
    So I've submitted a bug report against integer for this - in case there's someone who cares enough to fix it. (I hit "Send" before thinking to reference the original PM post in that report ... sorry 'bout that.)

    NP. It's more likely to get taken seriously with (only) your name attached.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    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". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-19 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found