Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Problems with number resolution

by Laurent_R (Canon)
on Jan 02, 2018 at 08:42 UTC ( [id://1206530]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Problems with number resolution
in thread Problems with number resolution

Yes, I wrote my message too quickly, you're right that some form of rounding is needed if you want to make sure to use integer addition; multiplying the numbers by 100 is not always sufficient to get proper integers.

Having said that, I still think that using just printf (or sprintf to convert the results and store them in an array) on the final result is probably sufficient to get the right precision (unless you're really adding huge volumes of numbers).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found