pjacklam / p5-bignum

Other
3 stars 1 forks source link

bignum behaviour change in 0.65 #2

Open powerman opened 2 years ago

powerman commented 2 years ago

I'm not sure is this correct or not, but it breaks some code (e.g. https://github.com/powerman/perl-Sub-Throttler/issues/4#issuecomment-1123729638).

$ cpanm -q bignum@0.64
bignum is up to date. (0.64)
$ perl -E 'use bignum; $v = 1.2; printf "%f %s (bignum %s)\n", $v, $v, $bignum::VERSION'                                                                          
1.200000 1.2 (bignum 0.64)
$ cpanm -q bignum@0.65
Successfully installed bignum-0.65 (upgraded from 0.64)
1 distribution installed
$ perl -E 'use bignum; $v = 1.2; printf "%f %s (bignum %s)\n", $v, $v, $bignum::VERSION'
0.000000 1.2 (bignum 0.65)

bigint behaviour wasn't changed:

$ perl -E 'use bigint; $v = 1.2; printf "%f %s (bigint %s)\n", $v, $v, $bigint::VERSION'
1.000000 1 (bigint 0.64)
$ perl -E 'use bigint; $v = 1.2; printf "%f %s (bigint %s)\n", $v, $v, $bigint::VERSION'
1.000000 1 (bigint 0.65)
pjacklam commented 1 year ago

This is an unfortunate incompatibility issue which happens when bignum versions 0.65 to 0.66 are used with Math-BigInt versions 1.999830 and 1.999831. The simplest solution is to upgrade the Math-BigInt distribution.