From 3b89bde227c043133449f51f759f62b7fbcb5786 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Sun, 27 Mar 2022 20:06:43 -0400 Subject: rename poz() and neg() to big_is_positive() and big_is_negative() --- big.h | 4 ++-- reduce.c | 6 +++--- types.c | 2 +- 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 */ -- cgit v1.2.1