"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It all comes back to how the computer actually stores and processes numbers. Floating point numbers are by nature inexact. If you need exact you need to use integer math and then correct for decimal places. See Bug? 1+1 != 2, Filthy Floats or the IEEE stuff here including What Every Computer Scientist Should Know about Floating-Point Arithmetic If you don't really care to much just use printf/sprintf
cheers tachyon s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print In reply to Re: Simple math gone wrong
by tachyon
|
|