aboutsummaryrefslogtreecommitdiffstats
path: root/test/mpfrrnd.awk
diff options
context:
space:
mode:
authorjohn haque <j.eh@mchsi.com>2012-03-07 07:35:18 -0600
committerjohn haque <j.eh@mchsi.com>2012-03-07 07:35:18 -0600
commitb5431a4825e325c61f4043e4d25e47d7891c228c (patch)
tree506dd7e7636f292b24e6bc81a81678762b9bf3e6 /test/mpfrrnd.awk
parent473623f186c3699c8886ccdd8a2afb7f4fe7a07e (diff)
downloadegawk-b5431a4825e325c61f4043e4d25e47d7891c228c.tar.gz
egawk-b5431a4825e325c61f4043e4d25e47d7891c228c.tar.bz2
egawk-b5431a4825e325c61f4043e4d25e47d7891c228c.zip
Bug fixes and tests for MPFR.
Diffstat (limited to 'test/mpfrrnd.awk')
-rw-r--r--test/mpfrrnd.awk15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mpfrrnd.awk b/test/mpfrrnd.awk
new file mode 100644
index 00000000..eafefb9f
--- /dev/null
+++ b/test/mpfrrnd.awk
@@ -0,0 +1,15 @@
+BEGIN {
+ N = 22/7
+ printf(" %.15f\n", N)
+
+ printf("* %.10f\n", N) # default
+ RNDMODE="N"; printf("N %.10f\n", N)
+ RNDMODE="U"; printf("U %.10f\n", N)
+ RNDMODE="D"; printf("D %.10f\n", N)
+ RNDMODE="Z"; printf("Z %.10f\n", N)
+ N = -N
+ RNDMODE="N"; printf("N %.10f\n", N)
+ RNDMODE="U"; printf("U %.10f\n", N)
+ RNDMODE="D"; printf("D %.10f\n", N)
+ RNDMODE="Z"; printf("Z %.10f\n", N)
+}