Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Answer: How do I round a number?

by Mago (Parson)
on Jul 09, 2003 at 19:25 UTC ( #272801=categorized answer: print w/replies, xml ) Need Help??

Q&A > math > How do I round a number? - Answer contributed by Mago

If you are using integers, and want to use Math::BigInt:


Math::BigInt - Arbitrary size integer math package

DESCRIPTION

All operators (inlcuding basic math operations) are overloaded if you declare your big integers as

  $i = new Math::BigInt '123_456_789_123_456_789';  

(snip)


METHODS

round

$x->round($A,$P,$round_mode); # round to accuracy or precision using + mode $r

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2016-09-25 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (465 votes). Check out past polls.