Thanks, looks like it's fallback (so called "div_scale", defaults to 40) value that was applied (and now I have a dejavu to have already investigated this a few years back). Either of
use bignum p => 0;
bignum> precision( 0 );
bignum> div_scale( 999 );
(or method calls on an instance) will help. That still doesn't feel right:
use strict;
use warnings;
use feature 'say';
use Data::Dump;
use bignum; #use bigint;
say my $x = 999999999921778071482940061661655974875633165533182;
dd $x;
dd $x> precision;
dd $x> accuracy;
dd $x> div_scale;
dd (Math::BigInt> precision);
dd (Math::BigInt> accuracy);
say my $y = $x / 1;
__END__
999999999921778071482940061661655974875633165533182
bless({
sign => "+",
value => bless([165533182, 974875633, 61661655, 71482940, 999921778,
+ 999999], "Math::BigInt::Calc"),
}, "Math::BigInt")
undef
undef
40
undef
undef
999999999921778071482940061661655974875600000000000
But with bigint instead:
999999999921778071482940061661655974875633165533182
bless({
sign => "+",
value => bless([165533182, 974875633, 61661655, 71482940, 999921778,
+ 999999], "Math::BigInt::Calc"),
}, "Math::BigInt")
undef
undef
40
undef
undef
999999999921778071482940061661655974875633165533182
i.e. object of the same class, with the same properties, same global parameters, but result is different. Same (per dejavu) conclusion: avoid using bignum.
