Provides methods that permit use of floating-point numbers of arbitrary length. The following apply to all methods, except as noted:
The object $f remains unchanged.
All methods except fcmp return a number string (nstr) of the form /[+-]\d+E[+-]\d+/, with embedded whitespace ignored.
A return value of NaN indicates that either an input parameter was "Not a Number" or that an illegal operation was attempted.
A similar default scale value is computed for square roots.
new |
Creates a new object, $f.
fabs |
Returns absolute value of $f.
fadd |
Returns sum of nstr and $f.
fcmp |
Compares $f to nstr. Returns -1, 0, or 1 depending on whether $f is less than, equal to, or greater than nstr, or undef if nstr is not a number.
fdiv |
Returns $f divided by nstr to nplaces. If scale (the number of digits) is unspecified, division is computed to the number of digits given by:
max($div_scale, length(dividend)+length(divisor))
ffround |
Returns $f rounded at nth place.
fmul |
Returns $f multiplied by nstr.
fneg |
Returns negative of $f.
fnorm |
Returns normalization of $f.
fround |
Returns value of $frounded to n digits.
fsqrt |
Returns square root of $f to n places.
fsub |
Returns $f minus nstr.
8.141. locale | 8.143. Math::BigInt |
Copyright © 2002 O'Reilly & Associates. All rights reserved.