add test for drem, expand testing for and supress table output for copysign, drem
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12721 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
dfdc5e411e
commit
ba2286a9a9
@ -45,10 +45,12 @@ main(int argc, char **argv)
|
||||
fprintf(stdout, "value\tsin(value)\tbe_sin(value)\n");
|
||||
for (int i = -9 ; i <= 9 ; i++) {
|
||||
double f = (double)i;
|
||||
fprintf(stdout, "%0.1f\t%0.10f\t%0.10f\n", f, sin(f), be_sin(f));
|
||||
fprintf(stdout, "%0.1f\t%0.10f\t%0.10f", f, sin(f), be_sin(f));
|
||||
if (sin(f) != be_sin(f)) {
|
||||
fprintf(stdout, " **");
|
||||
result = B_ERROR;
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
|
||||
@ -56,27 +58,51 @@ main(int argc, char **argv)
|
||||
// test cos
|
||||
for (int i = -9 ; i <= 9 ; i++) {
|
||||
double f = (double)i;
|
||||
fprintf(stdout, "%0.1f\t%0.10f\t%0.10f\n", f, cos(f), be_cos(f));
|
||||
fprintf(stdout, "%0.1f\t%0.10f\t%0.10f", f, cos(f), be_cos(f));
|
||||
if (cos(f) != be_cos(f)) {
|
||||
fprintf(stdout, " **");
|
||||
result = B_ERROR;
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
|
||||
fprintf(stdout, "arg1\targ2\tcopysign()\tbe_copysign()\n");
|
||||
// test copysign
|
||||
for (int i = -2 ; i <= 2 ; i++) {
|
||||
for (int j = -2 ; j <= 2 ; j++) {
|
||||
for (int i = -9 ; i <= 9 ; i++) {
|
||||
for (int j = -9 ; j <= 9 ; j++) {
|
||||
double f = (double)i;
|
||||
double g = (double)j;
|
||||
fprintf(stdout, "%0.1f\t%0.1f\t%0.10f\t%0.10f\n",
|
||||
f, g, copysign(f, g), be_copysign(f, g));
|
||||
if (copysign(f, g) != be_copysign(f, g)) {
|
||||
double x = copysign(f, g);
|
||||
double y = be_copysign(f, g);
|
||||
if ((x != y) && !(isnan(x) && isnan(y))) {
|
||||
fprintf(stdout, "%0.1f\t%0.1f\t%0.6f\t%0.6f", f, g, x, y);
|
||||
fprintf(stdout, " **");
|
||||
fprintf(stdout, "\n");
|
||||
result = B_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
|
||||
fprintf(stdout, "arg1\targ2\tdrem(values)\tbe_drem(values)\n");
|
||||
// test drem
|
||||
for (int i = -21 ; i <= 21 ; i++) {
|
||||
for (int j = -36 ; j <= 36 ; j++) {
|
||||
double f = (double)i/3.0;
|
||||
double g = (double)j/4.0;
|
||||
double x = drem(f, g);
|
||||
double y = be_drem(f, g);
|
||||
if ((x != y) && !(isnan(x) && isnan(y))) {
|
||||
fprintf(stdout, "%0.2f\t%0.2f\t%0.10f\t%0.10f", f, g, x, y);
|
||||
fprintf(stdout, " **");
|
||||
fprintf(stdout, "\n");
|
||||
result = B_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
|
||||
fprintf(stdout, "result = %s\n", (result == B_OK ? "OK" : "ERROR"));
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user