Copyright (C) 2000-2012 |
Manpages Math::BigFloatSection: Perl Programmers Reference Guide (3perl)Updated: 2001-02-22 Index Return to Main Contents NAMEMath::BigFloat - Arbitrary length float math packageSYNOPSISuse 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 $f->fdiv(NSTR[,SCALE]) returns NSTR division to SCALE places $f->fmod(NSTR) returns NSTR modular remainder $f->fneg() return NSTR negation $f->fabs() return NSTR absolute value $f->fcmp(NSTR) return CODE compare undef,<0,=0,>0 $f->fround(SCALE) return NSTR round to SCALE digits $f->ffround(SCALE) return NSTR round at SCALEth place $f->fnorm() return (NSTR) normalize $f->fsqrt([SCALE]) return NSTR sqrt to SCALE places DESCRIPTIONAll basic math operations are overloaded if you declare your big floats as
$float = new Math::BigFloat "2.123123123123123123123123123123123";
BUGSThe current version of this module is a preliminary version of the real thing that is currently (as of perl5.002) under development.The printf subroutine does not use the value of $Math::BigFloat::rnd_mode when rounding values for printing. Consequently, the way to print rounded values is to specify the number of digits both as an argument to "ffround" and in the %f printf string, as follows:
printf "%.3f\n", $bigfloat->ffround(-3); AUTHORMark Biggar Patches by John Peacock Apr 2001 =cut
IndexThis document was created by man2html, using the manual pages. Time: 11:08:48 GMT, April 19, 2024 |