summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-04-01 06:22:06 +0000
committerRoland McGrath <roland@gnu.org>1992-04-01 06:22:06 +0000
commitb907ae7d4fa0951070e19a4698e5b49afa495e17 (patch)
treea579dcbff9632f7727060744464e5e2e80034c6e /math
parent02713965e1eda125476d7ebb485addb8c678e7b2 (diff)
Formerly ../math/test-math.c.~2~
Diffstat (limited to 'math')
-rw-r--r--math/test-math.c42
1 files changed, 40 insertions, 2 deletions
diff --git a/math/test-math.c b/math/test-math.c
index 4665d8cc34..3bb90ad283 100644
--- a/math/test-math.c
+++ b/math/test-math.c
@@ -7,11 +7,49 @@ int
DEFUN_VOID(main)
{
CONST char str[] = "123.456";
- double x;
+ double x,y,z,h,li,lr,a,lrr;
x = atof (str);
printf ("%g %g\n", x, pow (10.0, 3.0));
-
+
+ x = sinh(2.0);
+
+ fprintf(stderr,"sinh(2.0) = %g\n", x);
+
+ x = sinh(3.0);
+
+ fprintf(stderr,"sinh(3.0) = %g\n", x);
+
+ h = hypot(2.0,3.0);
+
+ fprintf(stderr,"h=%g\n", h);
+
+ a = atan2(3.0, 2.0);
+
+ fprintf(stderr,"atan2(3,2) = %g\n", a);
+
+ lr = pow(h,4.0);
+
+ fprintf(stderr,"pow(%g,4.0) = %g\n", h, lr);
+
+ lrr = lr;
+
+ li = 4.0 * a;
+
+ lr = lr / exp(a*5.0);
+
+ fprintf(stderr,"%g / exp(%g * 5) = %g\n", lrr, exp(a*5.0), lr);
+
+ lrr = li;
+
+ li += 5.0 * log(h);
+
+ fprintf(stderr,"%g + 5*log(%g) = %g\n", lrr, h, li);
+
+ fprintf(stderr,"cos(%g) = %g, sin(%g) = %g\n", li, cos(li), li, sin(li));
+
+ fflush(stderr);
+
return 0;
}