Create bigint values explicitly eg.
Computations involving at least one such big integer will get infected and also become bigints. Other values, however, remain plain (non-big) perl number. If you wish to explicitly convert a big value back to a plain number, you can do one ofuse Math::BigInt; my $big = Math::BigInt->new( "2539885693349640669028422069904549631176 +10523116274484848568321143714323882724980122910689" );
(this may of course lose precision if that number is large).my $small = $big->numify; # OR my $small = "" . $big;
Update: you may also restrict use bignum; to smaller scopes, such as bare brace blocks, in which case numeric literals in those scopes are automatically upgraded to big integers.
In reply to Re: how to avoid Bigint module
by ambrus
in thread how to avoid Bigint module
by manojghosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |