From 69a209875107dce06174442d214c92f2fe748aae Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 28 Mar 2022 16:01:27 -0400 Subject: modify longdiv() and shortdiv() to return structs, eliminating another global, rename bigdiv() and bigmod() to big_divide() and big_remainder() to ensure no call sights are missed --- reduce.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'reduce.c') diff --git a/reduce.c b/reduce.c index 562d611..6f41d50 100644 --- a/reduce.c +++ b/reduce.c @@ -2075,8 +2075,8 @@ L3: if(arg1==NIL)lexfail(lastarg); GETARG(arg1); UPLEFT; if(tag[arg1]==DOUBLE||tag[lastarg]==DOUBLE)int_error("div"); - if(bigzero(lastarg))div_error(); /* build into bigmod ? */ - simpl(bigdiv(arg1,lastarg)); + if(bigzero(lastarg))div_error(); /* build into big_remainder ? */ + simpl(big_divide(arg1,lastarg)); goto DONE; case READY(FDIV): @@ -2086,7 +2086,7 @@ L3: if(arg1==NIL)lexfail(lastarg); /* experiment, suppressed if(tag[lastarg]==INT&&tag[arg1]==INT&&!bigzero(lastarg)) { extern word b_rem; - int d = bigdiv(arg1,lastarg); + int d = big_divide(arg1,lastarg); if(bigzero(b_rem)){ simpl(d); goto DONE; } } /* makes a/b integer if a, b integers dividing exactly */ fa=force_dbl(arg1); @@ -2100,8 +2100,8 @@ L3: if(arg1==NIL)lexfail(lastarg); GETARG(arg1); UPLEFT; if(tag[arg1]==DOUBLE||tag[lastarg]==DOUBLE)int_error("mod"); - if(bigzero(lastarg))div_error(); /* build into bigmod ? */ - simpl(bigmod(arg1,lastarg)); + if(bigzero(lastarg))div_error(); /* build into big_remainder ? */ + simpl(big_remainder(arg1,lastarg)); goto DONE; case READY(POWER): -- cgit v1.2.1