Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BigFloat.pm module

Status
Not open for further replies.

broloc

Programmer
Jun 10, 2002
27
JP
how do i use the ffround() function in BigFloat.pm?
i'd try something,but the output is not what i want.here's my code.
Code:
#!usr\bin\perl

use Math::BigFloat;

print "Enter input:";
$string = <STDIN>;
chomp $string;

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

$value = $f->ffround(zero);

print $value;

for example..i keyed in 22.3..and the output displayed is
+22E+0.can i have some advice..please?

 
try

printf &quot;%.3f\n&quot;, $f->ffround(0);
Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
million thanks to u..now,all i have to do is change the number '3' to decide how many floating point to be displayed.thnx!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top