Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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.

Comment on Re: Strange rounding Error in Perl
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2015-08-03 20:27 GMT
Find Nodes?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...

    Results (55 votes), past polls