Sidney Cadot dnia 28 wrz 2004 o 18:56 +0200 napisal: > But if you're calculating the average cost of N shopping items? The next step might be comparing that average to something with == :). > Yes it can. E.g. moving up from single to double precision (6 to 15 > decimal digits!) gets many realistic problems out of a zone where > numerical roundoff introduces so much noise that all information is > lost. I can't discuss with 'many realistic problems' argument :). Increasing precision just delays appearance of the problem (sometimes delays enough), it doesn't solve it. Change the scale and it will appear again. Most problems with FP can be easily avoided once you realize that they are almost never exact and remember about the involved error. ytm ps. How about putting brackets in various places to change the order of calculations? Take a look at the last problem from http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/overview/reals.html On my computer (with doubles): gcc -O2 -lm assoc.c -o assoc; ./assoc 56 56 gives results that differ more than 0.025. ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo@musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.Received on Wed Sep 29 01:14:15 2004
This archive was generated by hypermail 2.1.8 : 2004-09-29 01:14:24 CEST