You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module:
Math::BigInt::Calc
Afflicts both Math::BigInt and Math::BigFloat
Description
Initially I thought this was specific to Win32 and the __float128 nvtype.
Now I believe (unverified) that the problem will afflict every perl where IVSIZE==4 && NVSIZE==16.
(Note: AFAIK, the 80-bit extended precision long double is NOT subject to this issue, but will only ever report NVSIZE==16 when IVSIZE != 4.)
That this issue has never come up before is testament to the rarity of such a perl configuration.
There are a number of FAIL reports (all from Cygwin) for this - eg: https://www.cpantesters.org/cpan/report/aebbf2eb-6cf4-1014-b776-34ea06c191b3
And I can reproduce the issue on 32-bit builds on native MS Windows when ivsize is 4 and nvtype is __float128.
My thoughts about how to deal with it have changed as I've learned a bit more about the problem, though I still don't know what the troublesome code is doing. (I tried unsuccessfully to obtain some info about it from Daniel Pfeiffer who, apparently, wrote that code.)
AFAIK, the bug impacts ONLY upon integer values whose bitsize is in the range 33 to 53 (inclusive), and on 54-bit integer values whose decimal representation does not exceed 16 digits.
Attached is a simplistic patch (diff.txt) that hard codes values that work for this configuration into Calc.pm.
Given that we're dealing with a very rare configuration, I'm thinking that such a "permanent bandaid" might be all that's really needed.
I guess I'll probably need to present a new PR over at https://github.com/pjacklam/p5-Math-BigInt, but I'd like to get some feedback on whether this patch is acceptable before I do that.
First raised as pjacklam/p5-Math-BigInt#1 , which was later referenced at https://rt.cpan.org/Public/Bug/Display.html?id=134045
No responses yet received, so I'll raise it here.
Module:
Math::BigInt::Calc
Afflicts both Math::BigInt and Math::BigFloat
Description
Initially I thought this was specific to Win32 and the __float128 nvtype.
Now I believe (unverified) that the problem will afflict every perl where IVSIZE==4 && NVSIZE==16.
(Note: AFAIK, the 80-bit extended precision long double is NOT subject to this issue, but will only ever report NVSIZE==16 when IVSIZE != 4.)
That this issue has never come up before is testament to the rarity of such a perl configuration.
There are a number of FAIL reports (all from Cygwin) for this - eg:
https://www.cpantesters.org/cpan/report/aebbf2eb-6cf4-1014-b776-34ea06c191b3
And I can reproduce the issue on 32-bit builds on native MS Windows when ivsize is 4 and nvtype is __float128.
My thoughts about how to deal with it have changed as I've learned a bit more about the problem, though I still don't know what the troublesome code is doing. (I tried unsuccessfully to obtain some info about it from Daniel Pfeiffer who, apparently, wrote that code.)
AFAIK, the bug impacts ONLY upon integer values whose bitsize is in the range 33 to 53 (inclusive), and on 54-bit integer values whose decimal representation does not exceed 16 digits.
Attached is a simplistic patch (diff.txt) that hard codes values that work for this configuration into Calc.pm.
Given that we're dealing with a very rare configuration, I'm thinking that such a "permanent bandaid" might be all that's really needed.
I guess I'll probably need to present a new PR over at https://github.com/pjacklam/p5-Math-BigInt, but I'd like to get some feedback on whether this patch is acceptable before I do that.
Steps to Reproduce
Expected behavior
That one-liner should output:
0b101101101101101101101101101101101101
Perl configuration
diff.txt
The text was updated successfully, but these errors were encountered: