Quoting marc <[EMAIL PROTECTED]>:

That's right, one of the most basic operations in math, a thing that we learn to do before we can ride a bike, eludes the combined efforts of the finest engineers over the last 30 years. Of course, this is something that is intuitively nonsensical - why should it be impossible to round a floating-point number reliably?

Real mathematics programmers use bignums. ;-)

http://en.wikipedia.org/wiki/Bignum

I remember the first time I saw a floating point rounding error. A student I was teaching was rotating a vector shape on the screen by multiplying the angle by a fraction in a loop. The numbers were stored as C floats. As the shape rotated it
started to drift off-centre. I had difficulty believing that floats were the
problem given the low ranges being used, but after asking the maths lecturer's
advice we switched the code from using floats to using doubles. The shape then
rotated without drifting.

- Rob.

_______________________________________________
NetBehaviour mailing list
[email protected]
http://www.netbehaviour.org/mailman/listinfo/netbehaviour

Reply via email to