http://www.perlmonks.org?node_id=1284

Math::BigFloat

See the current Perl documentation for Math::BigFloat.

Here is our local, out-dated (pre-5.6) version:


Math::BigFloat - Arbitrary length float math package



  use Math::BigFloat;
  $f = Math::BigFloat->new($string);

  $f->fadd(NSTR) return NSTR            addition
  $f->fsub(NSTR) return NSTR            subtraction
  $f->fmul(NSTR) return NSTR            multiplication

    

All basic math operations are overloaded if you declare your big floats as

    $float = new Math::BigFloat "2.123123123123123123123123123123123";
number format

canonical strings have the form /[+-]\d+E[+-]\d+/ . Input values can have inbedded whitespace.

Error returns 'NaN'

An input parameter was ``Not a Number'' or divide by zero or sqrt of negative number.

Division is computed to

max($div_scale,length(dividend)+length(divisor)) digits by default. Also used for default sqrt scale.


BUGS

The current version of this module is a preliminary version of the real thing that is currently (as of perl5.002) under development.


AUTHOR

Mark Biggar