diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-27 20:06:43 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-27 20:06:43 -0400 |
commit | 3b89bde227c043133449f51f759f62b7fbcb5786 (patch) | |
tree | 49ec51d6c08b8ae3dfeb0c40233e280c4d3338a8 | |
parent | d8a7702a7255c9a829f4c57846f9257c4607f9cb (diff) |
rename poz() and neg() to big_is_positive() and big_is_negative()
-rw-r--r-- | big.h | 4 | ||||
-rw-r--r-- | reduce.c | 6 | ||||
-rw-r--r-- | types.c | 2 |
3 files changed, 6 insertions, 6 deletions
@@ -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) @@ -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; @@ -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 */ |