trouble with high precision computation using Math::BigFloat

From: Jack (jack_posemsky_at_yahoo.com)
Date: 06/24/04


Date: 24 Jun 2004 13:01:24 -0700

Hi folks, the perldoc on this is somewhat cryptic and wondering if
anyone experienced using big float can help me understand how to big
floatify my program...I added the following code around my variables
but to be honest havent a clue as to how to use big float b/c my
experiment failed and floating pt precision was not increased from 15
decimal spaces to larger. Any tips on its usage would be appreciated:

use Math::BigFloat;
use Math::BigFloat lib => 'GMP';

Math::BigFloat->precision(30);
$x = Math::BigFloat->new($str);
$x->precision(25);
$a = Math::BigFloat->new($str);
$a->precision(25);
$a1 = Math::BigFloat->new($str);
$a1->precision(25);
$line = Math::BigFloat->new($str);
$line->precision(25);
$p = Math::BigFloat->new($str);
$p->precision(25);
$a1->bfround(25);
$a->bfround(25);
$line->bfround(25);
$p->bfround(25);
$x->bfround(25);



Relevant Pages

  • Re: How to check if a String input is integer, float or NAN
    ... > Hello folks, ... > method but don't know how to use it for float. ... > not exposed to exceptions at all. ... was in and each 'column' represented a possible input character. ...
    (comp.lang.java.programmer)
  • Thank you to everyone
    ... I will have to experiment a bit, but you folks gave me some useful ... float that goes up in value. ... I can do a binary search, but I was wondering if there is a faster way to ... do this.Some of these arrays have a lot of elements and I do this a lot. ...
    (microsoft.public.vc.language)
  • Re: Positioning problem in FF vs IE
    ... wish folks would learn how to articulate their problems!) ... solution would be to remove float on div.Level1_right and add 'overflow: ...
    (alt.html)
  • Re: regexp for finding floats in a string
    ... perldoc -q float ... Your mail client runs on a Mac, ...
    (comp.lang.ruby)
  • Re: Why do i get an error for this ?
    ... > Thanks folks. ... one of your constructors can indeed accept arguments ... and precision than type 'float'. ... Nothing prevents it from having the same range and precision ...
    (comp.lang.cpp)