summaryrefslogtreecommitdiff
path: root/libm/float/powtst.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-10 00:40:28 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-10 00:40:28 +0000
commit1077fa4d772832f77a677ce7fb7c2d513b959e3f (patch)
tree579bee13fb0b58d2800206366ec2caecbb15f3fc /libm/float/powtst.c
parent22358dd7ce7bb49792204b698f01a6f69b9c8e08 (diff)
uClibc now has a math library. muahahahaha!
-Erik
Diffstat (limited to 'libm/float/powtst.c')
-rw-r--r--libm/float/powtst.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/libm/float/powtst.c b/libm/float/powtst.c
new file mode 100644
index 000000000..ff4845de2
--- /dev/null
+++ b/libm/float/powtst.c
@@ -0,0 +1,41 @@
+#include <stdio.h>
+#include <math.h>
+extern float MAXNUMF, MAXLOGF, MINLOGF;
+
+int
+main()
+{
+float exp1, minnum, x, y, z, e;
+exp1 = expf(1.0F);
+
+minnum = powif(2.0F,-149);
+
+x = exp1;
+y = MINLOGF + logf(0.501);
+/*y = MINLOGF - 0.405;*/
+z = powf(x,y);
+e = (z - minnum) / minnum;
+printf("%.16e %.16e\n", z, e);
+
+x = exp1;
+y = MAXLOGF;
+z = powf(x,y);
+e = (z - MAXNUMF) / MAXNUMF;
+printf("%.16e %.16e\n", z, e);
+
+x = MAXNUMF;
+y = 1.0F/MAXLOGF;
+z = powf(x,y);
+e = (z - exp1) / exp1;
+printf("%.16e %.16e\n", z, e);
+
+
+x = exp1;
+y = MINLOGF;
+z = powf(x,y);
+e = (z - minnum) / minnum;
+printf("%.16e %.16e\n", z, e);
+
+
+exit(0);
+}