All pastes #58834 Raw Edit

FPU Error 2

public text v1 · immutable
#58834 ·published 2006-05-25 15:58 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) {
                        fprintf (stdout, "\td = %d when c = %d , a = %d , b = %d\n",d,c,a,b);
                 }
                usleep(1000);
//      printf("%d\t\r",b);
        }
        fprintf(stdout,"\r%d\t.",a);
 }
fprintf(stdout,"\tDone.\n");
fflush(stdout);
return 1;
}