home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Math::BigFloat.z / Math::BigFloat
Encoding:
Text File  |  1998-10-30  |  2.6 KB  |  133 lines

  1.  
  2.  
  3.  
  4. MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))                                            MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Math::BigFloat - Arbitrary length float math package
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.        use Math::BogFloat;
  13.        $f = Math::BigFloat->new($string);
  14.  
  15.        $f->fadd(NSTR) return NSTR            addition
  16.        $f->fsub(NSTR) return NSTR            subtraction
  17.        $f->fmul(NSTR) return NSTR            multiplication
  18.        $f->fdiv(NSTR[,SCALE]) returns NSTR   division to SCALE places
  19.        $f->fneg() return NSTR                negation
  20.        $f->fabs() return NSTR                absolute value
  21.        $f->fcmp(NSTR) return CODE            compare undef,<0,=0,>0
  22.        $f->fround(SCALE) return NSTR         round to SCALE digits
  23.        $f->ffround(SCALE) return NSTR        round at SCALEth place
  24.        $f->fnorm() return (NSTR)             normalize
  25.        $f->fsqrt([SCALE]) return NSTR        sqrt to SCALE places
  26.  
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      All basic math operations are overloaded if you declare your big floats
  30.      as
  31.  
  32.          $float = new Math::BigFloat "2.123123123123123123123123123123123";
  33.  
  34.  
  35.      number format
  36.        canonical strings have the form /[+-]\d+E[+-]\d+/ .  Input values can
  37.        have inbedded whitespace.
  38.  
  39.      Error returns 'NaN'
  40.        An input parameter was "Not a Number" or divide by zero or sqrt of
  41.        negative number.
  42.  
  43.      Division is computed to
  44.        max($div_scale,length(dividend)+length(divisor)) digits by default.
  45.        Also used for default sqrt scale.
  46.  
  47. BBBBUUUUGGGGSSSS
  48.      The current version of this module is a preliminary version of the real
  49.      thing that is currently (as of perl5.002) under development.
  50.  
  51. AAAAUUUUTTTTHHHHOOOORRRR
  52.      Mark Biggar
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))                                            MMMMaaaatttthhhh::::::::BBBBiiiiggggFFFFllllooooaaaatttt((((3333))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.