From: ard at p850ug1.demon.co.uk
Students who have never used a low level
language, (INCLUDING CS GRADUATES
in many cases!), have a VERY difficult time accepting the concept that
floating point is an approximation, and therefore a lot of "ordinary"
arithmetic principles don't apply.
Thrivial example... On most (if not all) calculators, try something like
1 E 20 [enter] 1 + 1 E 20 -
(Ooops, that's in RPN, I've forgotten how to do it on a normal
calculator, try soemthing like 1 E20 + 1 = - 1 E 20 = )
Explain why the result is not 1 (OK, we all know the answer here...)
Hi
Sounds like a problem that involved a continuously running
clock that incremented a floating point accumulator. When it
started to saturate in about 18 days, they were no longer able
to calculate differential time.
Oh my, why didn't the missile fire?
Here is another one. I wish to do multiple precision but all
I have is a standard compiler that only does 32 bit math. I write
some utilities that allow me to handle the simple task of
extending the operations such that I can do a 64 bit integer divide
by a 32 bit number. I was careful to only do integer operations!
When I apply this new math to a XY table control, I notice
that right in the middle of the table, as I step along, it
jumps. Careful measurements of the size of the jump correspond
to one LSB of the upper 32 bits of my multiple precision operations.
So, what is wrong here? I also notice that the center of my
XY table is coordinate 0,0 ( hint ).
Dwight