trouble with high precision computation using Math::BigFloat
From: Jack (jack_posemsky_at_yahoo.com)
Date: 06/24/04
- Next message: F C: "Advise on modules for internationalization"
- Previous message: Jannar Molden: "Net::CDP and voice vlan"
- Next in thread: Sisyphus: "Re: trouble with high precision computation using Math::BigFloat"
- Reply: Sisyphus: "Re: trouble with high precision computation using Math::BigFloat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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);
- Next message: F C: "Advise on modules for internationalization"
- Previous message: Jannar Molden: "Net::CDP and voice vlan"
- Next in thread: Sisyphus: "Re: trouble with high precision computation using Math::BigFloat"
- Reply: Sisyphus: "Re: trouble with high precision computation using Math::BigFloat"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|