All pastes #58832 Raw Edit

FPU Error

public text v1 · immutable
#58832 ·published 2006-05-25 15:25 UTC
rendered paste body
Please use this program to help us verify an FPU error condition.
It performs 100000 multplications by 0 with a short usleep between each.
When the result is non-zero (impossible result), it is printed

Compile with:
gcc -o test-fp -Wall test-fp.c

Execute with:
./test-fp

#include <stdio.h>
#include <unistd.h>

int main() {
int a,b,c,d;
printf("Start.\n");
for(a=0; a<1000 ; a++) {
        for(b=0; b<100 ; b++) {
                c = 0;
                d = (int) ( (float)c * .025);
                if (d != 0) {
                        printf ("\td = %d when c = %d , a = %d , b = %d\n",d,c,a,b);
                 }
                usleep(1000);
         }
        printf("\r%d\t.",a);
 }
printf("\tDone.\n");
return 1;
}