I think what kyle was trying to say is that you will always have errors with floating-point. The only way to avoid them is to rescale all your operations to used fixed- point math. It can be done. Before system designers had math co-processor chips and Pentium uber-chips many analog systems were designed using fixed point math.
s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s
|-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,,
$|=1,select$,,$,,$,,1e-1;print;redo}
| [reply] |
starbolin is correct. I struggled through a whole semester about nothing but floating point problems, and almost the only thing I took away from it was, "don't use floating point numbers."
There are an infinite number of real numbers between 0 and 1, but only a finite number of them can be represented the way floats are normally stored. Out between 100 and 101, there is the same infinity of real numbers, but even fewer of them can be represented.
Looking at the number line through the filter of a float is a sea of emptiness and disappointment, I tell you!
| [reply] |