Re: Kernel math prob? or other problem? (fwd)

Mark W. Eichin (eichin@mit.edu)
Thu, 29 Jun 95 09:54:43 -0400


I'm not sure if this was broken in FSF-2.6.3 (and one never knows what
HJ is using :-) -- but here's an example case for a major floating
point bug that was fixed between FSF-2.6.3 and FSF-2.7.0 [and is a
good reason to upgrade, unlike ELF] The mucking with variables is to
make sure it didn't get optimized too much. Note that the argument to
printf, if assigned to a variable, works fine -- the issue is the
temporary calculation and subtleties of the 387 stack...

This bug did break dump-0.2b (ie. the program was fine, once I
upgraded to 2.7.0 it even worked quite well...)
_Mark_

#include <stdio.h>
int top;
int bottom;
main() {
foo();
printf("%f\n", (top * 100.0) / bottom);
}
foo() {
top = 42;
bottom = 93;
}