blob: 7e7e796d5e7498043dc454233a304937c7d1368c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
extern double test_sqrt(double);
int main( int argc, char** argv ) {
for( int i=0; i<10; i++ ) {
double d = test_sqrt((double)i), expect = sqrt((double)i);
double delta = fabs(d-expect);
printf("%d %f (%g)\n",i,d,delta);
if( delta > 1e-15 )
return 1;
}
return 0;
}
|