-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore non-havePack64 logic for negative integers #30
base: master
Are you sure you want to change the base?
Restore non-havePack64 logic for negative integers #30
Conversation
This was dropped in the refactor of 1.505. I guess Perls without 64-bit integers are rare these days; I only encountered it on a Raspberry Pi.
3 similar comments
Can you verify that the macOS plists tools can handle these numbers? As I recall, we had to drop some of this stuff because we were generating plist files that would cause problems. I noted in the Changes that these numbers had to be longs. Along with this, could you add some tests to write and read the data to verify they round trip? |
Acknowledged, and thanks for both the module and the feedback. Will do. Maybe over the weekend (and the check is in the mail ...) |
I gave it the old college try. The tests have been expanded to include pretty much the whole range of 64-bit integers, both positive and negative, with the ones over 32 bits represented as The implementation of negative integers basically computes the 64-bit 2s complement and then treats the result as a 54-bit non-negative integer. Non-negative integers are handled by extracting I have not yet done a full round-trip test, though I am willing to do so. As I understand it, this would start with a hand-rolled |
Looks like some of the earlier versions of Perl have problems. I will look into this. |
I don't know what to make of the coverage test failures. I do duplicate the Perl 5.12 module test failure, though. I will investigate further, but one possible solution is a version bump on the |
It looks like v5.10 and v5.12 need a better Math::BigInt. No idea why. I made a few changes in the workflows branch that you can merge. Or cherry-pick the commits that you want. Don't worry about coverage right now. Once it's working we can figure out that bit. |
The failing test in Unfortunately the My tests also include the smallest signed 64-bit integer, and that test passed, but I have not investigated whether the Interestingly, the code of the At this point it looks like the critical dependency is an indirect one from An alternate implementation that might (or might not) sidestep this whole mess is to implement Right now I have no conclusion to any of this. I'm just letting you know where I am at the moment. |
If the current Math::BigInt works, and it appears so, I wouldn't worry too much about the why. |
I looked in Apple code in CFBinaryPList.c. It seems to support integers of arbitrary precision, and it specifically mentions 64-bit. So, that answers this question. |
This was dropped in the refactor of 1.505. I guess Perls without 64-bit integers are rare these days; I only encountered it on a Raspberry Pi.