summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-03-27 20:06:43 -0400
committerJakob Kaivo <jkk@ung.org>2022-03-27 20:06:43 -0400
commit3b89bde227c043133449f51f759f62b7fbcb5786 (patch)
tree49ec51d6c08b8ae3dfeb0c40233e280c4d3338a8
parentd8a7702a7255c9a829f4c57846f9257c4607f9cb (diff)
rename poz() and neg() to big_is_positive() and big_is_negative()
-rw-r--r--big.h4
-rw-r--r--reduce.c6
-rw-r--r--types.c2
3 files changed, 6 insertions, 6 deletions
diff --git a/big.h b/big.h
index ce8b91c..36d1ba2 100644
--- a/big.h
+++ b/big.h
@@ -17,8 +17,8 @@
#define digit0(x) (hd[x]&MAXDIGIT)
#define digit(x) hd[x]
#define rest(x) tl[x]
-#define poz(x) (!(hd[x]&SIGNBIT))
-#define neg(x) (hd[x]&SIGNBIT)
+#define big_is_positive(x) (!(hd[x]&SIGNBIT))
+#define big_is_negative(x) (hd[x]&SIGNBIT)
#define bigzero(x) (!digit(x)&&!rest(x))
#define getsmallint(x) (hd[x]&SIGNBIT?-digit0(x):digit(x))
#define stosmallint(x) make(INT,(x)<0?SIGNBIT|(-(x)):(x),0)
diff --git a/reduce.c b/reduce.c
index 24c3241..562d611 100644
--- a/reduce.c
+++ b/reduce.c
@@ -532,7 +532,7 @@ word e;
lastarg= reduce(lastarg); /* ### */
if(tag[lastarg]==INT)
{ hold = bigsub(lastarg,arg1);
- if(poz(hold))hd[e]=arg2,tl[e]=hold;
+ if(big_is_positive(hold))hd[e]=arg2,tl[e]=hold;
else hd[e]=I,e=tl[e]=FAIL; }
else hd[e]=I,e=tl[e]=FAIL;
goto NEXTREDEX;
@@ -2114,7 +2114,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
fb=get_dbl(lastarg); }else
if(tag[arg1]==DOUBLE)
fa=get_dbl(arg1),fb=bigtodbl(lastarg); else
- if(neg(lastarg))
+ if(big_is_negative(lastarg))
fa=bigtodbl(arg1),fb=bigtodbl(lastarg);
else { simpl(bigpow(arg1,lastarg));
goto DONE; }
@@ -2175,7 +2175,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
GETARG(arg2);
UPLEFT;
hd[e]=ap(GENSEQ,cons(arg1,arg2));
- if(tag[arg1]==INT?poz(arg1):get_dbl(arg1)>=0.0)
+ if(tag[arg1]==INT?big_is_positive(arg1):get_dbl(arg1)>=0.0)
tag[tl[hd[e]]]=AP; /* hack to record sign of step - see GENSEQ */
goto NEXTREDEX;
diff --git a/types.c b/types.c
index f872b13..8888b9d 100644
--- a/types.c
+++ b/types.c
@@ -1564,7 +1564,7 @@ word x;
x=tl[x]; fprintf(f,","); }
out_pattern(f,hd[x]); fprintf(f,","); out_pattern(f,tl[x]);
fprintf(f,")"); } else
- if(tag[x]==INT&&neg(x)||tag[x]==DOUBLE&&get_dbl(x)<0)
+ if(tag[x]==INT&&big_is_negative(x)||tag[x]==DOUBLE&&get_dbl(x)<0)
{ fprintf(f,"("); out(f,x); fprintf(f,")"); } /* -ve numbers */
else
out(f,x); /* all other cases */