summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2022-03-28 16:31:47 -0400
committerJakob Kaivo <jkk@ung.org>2022-03-28 16:31:47 -0400
commit774e2bbb0e363d29394239b9848a519bc68ac4e1 (patch)
tree02f418635aaf32e23c36210cd229850a5eeeb98c
parent600b548442dc0679f89b16ebb6225bdc4465db37 (diff)
rename bigtodbl() to big_tod()
-rw-r--r--big.c2
-rw-r--r--big.h4
-rw-r--r--reduce.c18
3 files changed, 12 insertions, 12 deletions
diff --git a/big.c b/big.c
index 17fdebc..9ac3b5d 100644
--- a/big.c
+++ b/big.c
@@ -633,7 +633,7 @@ word bigpow(word x, word y)
return r;
}
-double bigtodbl(word x)
+double big_tod(word x)
{
word s = big_is_negative(x);
double b = 1.0;
diff --git a/big.h b/big.h
index 3a1ef69..6d494fa 100644
--- a/big.h
+++ b/big.h
@@ -24,7 +24,7 @@
long long big_toll(word);
word big_fromll(long long);
-double bigtodbl(word);
+double big_tod(word);
double biglog(word);
double biglog10(word);
int bigcmp(word,word);
@@ -46,7 +46,7 @@ word dbltobig(double);
int isnat(word);
word strtobig(word,int);
-#define force_dbl(x) ((tag[(x)] == INT) ? bigtodbl((x)) : get_dbl((x)))
+#define force_dbl(x) ((tag[(x)] == INT) ? big_tod((x)) : get_dbl((x)))
/* END OF DEFINITIONS FOR INTEGER PACKAGE */
diff --git a/reduce.c b/reduce.c
index 6dcdb64..89ef941 100644
--- a/reduce.c
+++ b/reduce.c
@@ -70,10 +70,10 @@ word a,b;
L: switch(tag[a])
{ case DOUBLE:
if(tag[b]==DOUBLE)return(fsign(get_dbl(a)-get_dbl(b)));
- else return(fsign(get_dbl(a)-bigtodbl(b)));
+ else return(fsign(get_dbl(a)-big_tod(b)));
case INT:
if(tag[b]==INT)return(bigcmp(a,b));
- else return(fsign(bigtodbl(a)-get_dbl(b)));
+ else return(fsign(big_tod(a)-get_dbl(b)));
case UNICODE: return sign(get_char(a)-get_char(b));
case ATOM:
if(tag[b]==UNICODE) return sign(get_char(a)-get_char(b));
@@ -2044,7 +2044,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
if(tag[arg1]==DOUBLE)
setdbl(e,get_dbl(arg1)+force_dbl(lastarg)); else
if(tag[lastarg]==DOUBLE)
- setdbl(e,bigtodbl(arg1)+get_dbl(lastarg));
+ setdbl(e,big_tod(arg1)+get_dbl(lastarg));
else simpl(bigplus(arg1,lastarg));
goto DONE;
@@ -2055,7 +2055,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
if(tag[arg1]==DOUBLE)
setdbl(e,get_dbl(arg1)-force_dbl(lastarg)); else
if(tag[lastarg]==DOUBLE)
- setdbl(e,bigtodbl(arg1)-get_dbl(lastarg));
+ setdbl(e,big_tod(arg1)-get_dbl(lastarg));
else simpl(bigsub(arg1,lastarg));
goto DONE;
@@ -2066,7 +2066,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
if(tag[arg1]==DOUBLE)
setdbl(e,get_dbl(arg1)*force_dbl(lastarg)); else
if(tag[lastarg]==DOUBLE)
- setdbl(e,bigtodbl(arg1)*get_dbl(lastarg));
+ setdbl(e,big_tod(arg1)*get_dbl(lastarg));
else simpl(bigtimes(arg1,lastarg));
goto DONE;
@@ -2113,9 +2113,9 @@ L3: if(arg1==NIL)lexfail(lastarg);
if(fa<0.0)errno=EDOM,math_error("^");
fb=get_dbl(lastarg); }else
if(tag[arg1]==DOUBLE)
- fa=get_dbl(arg1),fb=bigtodbl(lastarg); else
+ fa=get_dbl(arg1),fb=big_tod(lastarg); else
if(big_is_negative(lastarg))
- fa=bigtodbl(arg1),fb=bigtodbl(lastarg);
+ fa=big_tod(arg1),fb=big_tod(lastarg);
else { simpl(bigpow(arg1,lastarg));
goto DONE; }
errno=0; /* to clear */
@@ -2145,7 +2145,7 @@ L3: if(arg1==NIL)lexfail(lastarg);
hd[e]=I; e=tl[e]=str_conv(linebuf);
goto DONE;
-#define coerce_dbl(x) tag[x]==DOUBLE?(x):sto_dbl(bigtodbl(x))
+#define coerce_dbl(x) tag[x]==DOUBLE?(x):sto_dbl(big_tod(x))
case READY(STEP): /* STEP i a => GENSEQ (i,NIL) a */
RESTORE(e);
@@ -2274,7 +2274,7 @@ word x,y;
{ if(tag[x]==DOUBLE)
return(sto_dbl(get_dbl(x)+force_dbl(y)));
if(tag[y]==DOUBLE)
- return(sto_dbl(bigtodbl(x)+get_dbl(y)));
+ return(sto_dbl(big_tod(x)+get_dbl(y)));
return(bigplus(x,y));
}