No such thing as a small change | |

PerlMonks |

## perlman:Math::BigIntby root (Scribe) |

on Dec 23, 1999 at 01:30 UTC ( #1285=perlfunc: print w/replies, xml ) | Need Help?? |

## Math::BigIntSee the current Perl documentation for Math::BigInt. Here is our local, out-dated (pre-5.6) version: Math::BigInt - Arbitrary size integer math package
use Math::BigInt; $i = Math::BigInt->new($string);
$i->bneg return BINT negation $i->babs return BINT absolute value $i->bcmp(BINT) return CODE compare numbers (undef,< **Canonical notation**-
Big integer value are strings of the form
`/^[+-]\d+$/` with leading zeros suppressed. **Input**-
Input values to these routines may be strings of the form
`/^\s*[+-]?[\d\s]+$/` . **Output**- Output values always always in canonical form
Actual math is done in an internal format consisting of an array whose first element is the sign (/^[+-]$/) and whose remaining elements are base 100000 digits with the least significant digit first. The string 'NaN' is used to represent the result when input arguments are not numbers, as well as the result of dividing by zero.
## EXAMPLES
'+0' canonical zero value ' -123 123 123' canonical value '-123123123' '1 23 456 7890' canonical value '+1234567890'
## Autocreating constants
After In particular
perl -MMath::BigInt=:constant -e 'print 2**100'
print the integer value of
## BUGSThe current version of this module is a preliminary version of the real thing that is currently (as of perl5.002) under development.
## AUTHORMark Biggar, overloaded interface by Ilya Zakharevich. |
Log In
^{?}
Chatterbox
^{?}
Other Users
^{?}
Others about the Monastery: (8)
As of 2017-01-24 22:07 GMT
Sections
^{?}
Information
^{?}
Find Nodes
^{?}
Leftovers
^{?}
Voting Booth
^{?}
Do you watch meteor showers?Results (211 votes). Check out past polls. |