summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-03-28 16:38:19 -0400
committerJakob Kaivo <jkk@ung.org>2022-03-28 16:38:19 -0400
commitc0ec26a98f6b2828d971cb2df88c3e7b7b96e858 (patch)
treeb6fcacb5feb8e6b533e384a127638b6ec631a2e5
parentb685352ab7b7567064725a13c8cc92e71010aa6f (diff)
rename bigtimes() to big_multiply()
-rw-r--r--big.c12
-rw-r--r--big.h2
-rw-r--r--reduce.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/big.c b/big.c
index e895def..8c96896 100644
--- a/big.c
+++ b/big.c
@@ -494,7 +494,7 @@ int big_compare(word x, word y)
}
/* naive multiply - quadratic */
-word bigtimes(word x, word y)
+word big_multiply(word x, word y)
{
/* important optimisation */
if (big__len(x) < big__len(y)) {
@@ -610,9 +610,9 @@ word big_pow(word x, word y)
d = digit(y);
while (i--) {
if (d & 1) {
- r = bigtimes(r, x);
+ r = big_multiply(r, x);
}
- x = bigtimes(x, x);
+ x = big_multiply(x, x);
d >>= 1;
}
y = rest(y);
@@ -620,13 +620,13 @@ word big_pow(word x, word y)
d = digit(y);
if (d & 1) {
- r = bigtimes(r, x);
+ r = big_multiply(r, x);
}
while (d >>= 1) {
- x = bigtimes(x, x);
+ x = big_multiply(x, x);
if (d & 1) {
- r = bigtimes(r, x);
+ r = big_multiply(r, x);
}
}
diff --git a/big.h b/big.h
index 44b2b26..3617d90 100644
--- a/big.h
+++ b/big.h
@@ -37,7 +37,7 @@ word big_pow(word,word);
word bigscan(char *);
void bigsetup(void);
word big_subtract(word,word);
-word bigtimes(word,word);
+word big_multiply(word,word);
word bigtostr(word);
word bigtostr8(word);
word bigtostrx(word);
diff --git a/reduce.c b/reduce.c
index 956d5dc..2d72394 100644
--- a/reduce.c
+++ b/reduce.c
@@ -2067,7 +2067,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
setdbl(e,get_dbl(arg1)*force_dbl(lastarg)); else
if(tag[lastarg]==DOUBLE)
setdbl(e,big_tod(arg1)*get_dbl(lastarg));
- else simpl(bigtimes(arg1,lastarg));
+ else simpl(big_multiply(arg1,lastarg));
goto DONE;
case READY(INTDIV):