No such thing as a small change | |
PerlMonks |
Re: Fix floats like you do in your headby mojotoad (Monsignor) |
on Dec 24, 2002 at 21:32 UTC ( [id://222136]=note: print w/replies, xml ) | Need Help?? |
This is a clever way to deal with the problem, but not very consistent (in that some numbers are treated differently than others) -- this inconsistency will make most mathematicians and scientists quake in their boots.
The proper solution is to define an epsilon that represents the precision used to compensate for accumulated rounding errors. Indeed, this is the driving force behind the IEEE 754 standard. Also of interest: What Every Computer Scientist Should Know About Floating-Point Arithmetic (1991) by David Golberg, is a great discussion of the IEEE 754 standard and its practical application. Matt
In Section
Cool Uses for Perl
|
|