Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Rounding over numbers

by BillKSmith (Monsignor)
on Feb 15, 2016 at 21:50 UTC ( [id://1155299]=note: print w/replies, xml ) Need Help??


in reply to Rounding over numbers

There are at least six ways to handle a "final 5" (toward positive infinity, toward negative infinity, toward even, toward odd, toward zero, away from zero). And this is before you even consider floating point issues. Fortunately, for most applications, it does not matter which you choose. If you are certain that your application is one of the exceptions, It is probably best to write your own rounding routine and test it thoroughly. This is the only way to be sure that future changes to a library will not break your code. If you choose to use an existing library, you should test every case is handled the way your application requires.
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-23 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found