Allows use of arbitrary length integers, in which the following apply to all methods, except as noted:
The object $i remains unchanged.
Big integer strings (bints) have the form /^\s*[+-]?[\d\s]+$/.
All methods except bcmp return a big integer string or strings.
Embedded whitespace is ignored.
Output values are always in the canonical form: /^[+-]\d+$/.
The return value NaN results when an input argument is not a number, or when a divide by zero is attempted.
new |
Creates a new object, $i.
babs |
Returns absolute value of $i.
badd |
Returns sum of bint and $i.
bcmp |
Compares $i to bint. The bcmp method returns -1, 0, or 1 depending on whether $f is less than, equal to, or greater than the number string given as an argument. If the number string is undefined or null, undef is returned.
bdiv |
Returns $i divided by bint. In list context, returns a two-element array containing the quotient of the division and the remainder; in scalar context, returns only the quotient.
bgcd |
Returns greatest common divisor of $i and bint.
bmod |
Returns $i modulus bint.
bmul |
Returns $i multiplied by bint.
bneg |
Returns negative of $i.
bnorm |
Returns normalization of $i.
bsub |
Returns $i minus bint.
8.142. Math::BigFloat | 8.144. Math::BigInt::Calc |
Copyright © 2002 O'Reilly & Associates. All rights reserved.