in reply to Re^2: Why am I losing accuracy?
in thread Why am I losing accuracy?

I am curious about how to assign Math::BigInt or Math::BigFloat (or bignum or bigint) only for the variables that need it. Can you enlighten me on how to do that?

In that case don't use bignum;, instead use Math::BigInt; and/or use Math::BigFloat;, and then create the objects explicitly, as in my $i = Math::BigInt->new(1);. If you're done with the calculations and don't want them to be objects anymore, you can stringify them, e.g. $i = "$1"; - don't use them as numbers or you'll loose the accuracy.