summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2002-04-26 22:54:59 +0200
committerKevin Ryde <user42@zip.com.au>2002-04-26 22:54:59 +0200
commite8500b6c99297f7b806c783a2118af2ea3da708d (patch)
tree2082ee585c3d7f5194fec6e7f2b6039643cbd6d1 /demos
parent3a9a81ba9cdf6b742412b725e966a4f5fc9c5a7c (diff)
downloadgmp-e8500b6c99297f7b806c783a2118af2ea3da708d.tar.gz
* demos/expr/exprfr.c: Add nan and inf constants.
* demos/expr/t-expr.c: Exercise them.
Diffstat (limited to 'demos')
-rw-r--r--demos/expr/t-expr.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/demos/expr/t-expr.c b/demos/expr/t-expr.c
index 4cfb0bee7..7f07b42b9 100644
--- a/demos/expr/t-expr.c
+++ b/demos/expr/t-expr.c
@@ -307,8 +307,24 @@ const struct data_t data_r[] = {
{ 0, "inf_p(1/0)", "1" },
{ 0, "inf_p(sqrt(-1))", "0" },
{ 0, "inf_p(1)", "0" },
-
+ { 0, "inf_p(nan)", "0" },
+ { 0, "inf_p(inf)", "1" },
+ { 0, "inf_p(-inf)", "1" },
+
+ { 0, "inf > 0", "1" },
+ { 0, "inf == 0", "0" },
+ { 0, "inf < 0", "0" },
+ { 0, "-inf > 0", "0" },
+ { 0, "-inf == 0", "0" },
+ { 0, "-inf < 0", "1" },
+ { 0, "inf == inf", "1" },
+ { 0, "inf != inf", "0" },
+ { 0, "inf == -inf", "0" },
+ { 0, "inf != -inf", "1" },
+
+ { 0, "nan_p(log(-1))", "1" },
{ 0, "inf_p(log(0))", "1" },
+ { 0, "log(0) == -inf", "1" },
{ 0, "log(1)", "~0" },
{ 0, "inf_p(log2(0))", "1" },
@@ -329,11 +345,17 @@ const struct data_t data_r[] = {
{ 0, "nan_p(1/0)", "0" },
{ 0, "nan_p(sqrt(-1))", "1" },
{ 0, "nan_p(1)", "0" },
+ { 0, "nan_p(nan)", "1" },
+ { 0, "nan_p(inf)", "0" },
+ { 0, "nan_p(-inf)", "0" },
{ 0, "number_p(-1)", "1" },
{ 0, "number_p(1/0)", "0" },
{ 0, "number_p(sqrt(-1))", "0" },
{ 0, "number_p(1)", "1" },
+ { 0, "number_p(nan)", "0" },
+ { 0, "number_p(inf)", "0" },
+ { 0, "number_p(-inf)", "0" },
{ 0, "round(0)", "0" },
{ 0, "round(0.25)", "0" },