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

Re: Strange rounding Error in Perl

by pg (Canon)
on Nov 21, 2004 at 21:52 UTC ( #409436=note: print w/replies, xml ) Need Help??


in reply to Strange rounding Error in Perl

Other than those discussion people had before, if precision is so important, for example, this is a finance, or money related program, use bignum.

use bignum; print 215.88-214.89;

This gives you 0.99. But you have to fully understand the performance implication by doing this.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://409436]
help
Chatterbox?
[ambrus]: Corion: which coordinate system is the upside down one?
[Corion]: ambrus: "the other" ;) To me, "normal" for GUIs means (0,0) is left-upper corner of the monitor/window. But for Prima, the lower-left corner it is ;)
[Corion]: Which would be OK for mathematics and paper, for me ;)
[ambrus]: Ok, so Prima has a postscript-like coordinate system

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2016-12-09 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.