![]() |
|
No such thing as a small change | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
Update: salva's Math::Int64 solved the problem with none of the pain I was expecting. When working with large (>2**63) integers on a 64-bit build of perl, division/modulus operations get screwy. The cause is that the results are automatically morphed into floating point numbers. The problem is, they don't have the precision to hold the results:
Note the loss of precision in the division result. In an attempt to prevent the morphing to fp, I tried integer, but that creates a different problem:
How does the division of one positive number by another positive number render a negative result? (When what should be unsigned division is done as signed?) The latest I've tried this on is 5.18, so it might have been fixed in later builds, but that's not a solution for me at the moment. Can anyone think of a simple work around that doesn't involve Math::BigInt or Math::Int128? 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
In reply to 64-bit division anomolies (Solved.) by BrowserUk
|
|