diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-28 16:34:27 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-28 16:34:27 -0400 |
commit | 8d2224f1227e8da595ff4db29d805908a91609bf (patch) | |
tree | 2c335138a02fa3b507fe034195dd13cccff0b553 | |
parent | e1d7c2294075f5a59e276bb2dd7af79772443234 (diff) |
rename bigcmp() to big_compare()
-rw-r--r-- | big.c | 12 | ||||
-rw-r--r-- | big.h | 2 | ||||
-rw-r--r-- | reduce.c | 4 |
3 files changed, 9 insertions, 9 deletions
@@ -154,7 +154,7 @@ static struct big_div big__shortdiv(word x, word n) /* may assume - x>=0,y>0 */ static struct big_div big__longdiv(word x, word y) { - if (bigcmp(x, y) < 0) { + if (big_compare(x, y) < 0) { struct big_div bd = { .quo = make(INT, 0, 0), .rem = x, @@ -175,7 +175,7 @@ static struct big_div big__longdiv(word x, word y) word n = 0; word q = 0; word ly = big__len(y); - while (bigcmp(x, y = make(INT, 0, y)) >= 0) { + while (big_compare(x, y = make(INT, 0, y)) >= 0) { n++; } @@ -187,7 +187,7 @@ static struct big_div big__longdiv(word x, word y) d = 0; } else if (lx == ly) { - if (bigcmp(x, y) >= 0) { + if (big_compare(x, y) >= 0) { x = bigsub(x, y); d = 1; } else { @@ -206,9 +206,9 @@ static struct big_div big__longdiv(word x, word y) d = 0; } - if (bigcmp(x, y) >= 0) { + if (big_compare(x, y) >= 0) { x = bigsub(x, y), d++; - if (bigcmp(x, y) >= 0) { + if (big_compare(x, y) >= 0) { x = bigsub(x, y); d++; } @@ -463,7 +463,7 @@ word bigsub(word x, word y) } /* returns +ve,0,-ve as x greater than, equal, less than y */ -int bigcmp(word x, word y) +int big_compare(word x, word y) { word s = big_is_negative(x); if (big_is_negative(y) != s) { @@ -27,7 +27,7 @@ word big_fromll(long long); double big_tod(word); double big_log(word); double big_log10(word); -int bigcmp(word,word); +int big_compare(word,word); word big_divide(word, word); word big_remainder(word,word); word bignegate(word); @@ -72,7 +72,7 @@ word a,b; if(tag[b]==DOUBLE)return(fsign(get_dbl(a)-get_dbl(b))); else return(fsign(get_dbl(a)-big_tod(b))); case INT: - if(tag[b]==INT)return(bigcmp(a,b)); + if(tag[b]==INT)return(big_compare(a,b)); else return(fsign(big_tod(a)-get_dbl(b))); case UNICODE: return sign(get_char(a)-get_char(b)); case ATOM: @@ -592,7 +592,7 @@ word e; upleft; lastarg=reduce(lastarg); /* ### */ hd[e]=I; - e=tl[e]=(tag[lastarg]!=INT||bigcmp(arg1,lastarg))?FAIL:arg2; + e=tl[e]=(tag[lastarg]!=INT||big_compare(arg1,lastarg))?FAIL:arg2; /* note no coercion from INT to DOUBLE here */ goto NEXTREDEX; |