From 8d2224f1227e8da595ff4db29d805908a91609bf Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 28 Mar 2022 16:34:27 -0400 Subject: rename bigcmp() to big_compare() --- big.c | 12 ++++++------ big.h | 2 +- reduce.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/big.c b/big.c index 835706c..8396d48 100644 --- a/big.c +++ b/big.c @@ -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) { diff --git a/big.h b/big.h index d13e3a9..325754a 100644 --- a/big.h +++ b/big.h @@ -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); diff --git a/reduce.c b/reduce.c index 170d76f..5a7208d 100644 --- a/reduce.c +++ b/reduce.c @@ -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; -- cgit v1.2.1