Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Rounding

by Zaxo (Archbishop)
on Sep 23, 2002 at 03:54 UTC ( [id://200001]=note: print w/replies, xml ) Need Help??


in reply to Rounding

See perlfaq4 for why this happens, decimal fractions are not exactly representable in binary.

What you want is called banker's round. It tends to minimize cumulative errors, as well as giving a useful surplus of even numbers.

After Compline,
Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://200001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-05-26 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found