diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-11 11:34:05 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-09-11 11:34:44 -0700 |
commit | 40a031e177459f9e7e393fae3766578eed41bedc (patch) | |
tree | 9f6c7ae72a7cc461df71789d79e8e8c77ecde649 /src/floatfns.c | |
parent | 038a09041af20ed373b15715fbc859d4a305dda8 (diff) | |
download | emacs-40a031e177459f9e7e393fae3766578eed41bedc.tar.gz emacs-40a031e177459f9e7e393fae3766578eed41bedc.tar.bz2 emacs-40a031e177459f9e7e393fae3766578eed41bedc.zip |
Minor rounding_driver simplification
* src/floatfns.c (rounding_driver): Omit last arg, which is
now unused. All callers changed.
Signal overflow-error for bignum overflow
Diffstat (limited to 'src/floatfns.c')
-rw-r--r-- | src/floatfns.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/floatfns.c b/src/floatfns.c index 8e56fed9d09..6f5aee2db9d 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -339,8 +339,7 @@ static Lisp_Object rounding_driver (Lisp_Object arg, Lisp_Object divisor, double (*double_round) (double), void (*int_divide) (mpz_t, mpz_t const, mpz_t const), - EMACS_INT (*fixnum_divide) (EMACS_INT, EMACS_INT), - const char *name) + EMACS_INT (*fixnum_divide) (EMACS_INT, EMACS_INT)) { CHECK_NUMBER (arg); @@ -474,7 +473,7 @@ This rounds the value towards +inf. With optional DIVISOR, return the smallest integer no less than ARG/DIVISOR. */) (Lisp_Object arg, Lisp_Object divisor) { - return rounding_driver (arg, divisor, ceil, mpz_cdiv_q, ceiling2, "ceiling"); + return rounding_driver (arg, divisor, ceil, mpz_cdiv_q, ceiling2); } DEFUN ("floor", Ffloor, Sfloor, 1, 2, 0, @@ -483,7 +482,7 @@ This rounds the value towards -inf. With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR. */) (Lisp_Object arg, Lisp_Object divisor) { - return rounding_driver (arg, divisor, floor, mpz_fdiv_q, floor2, "floor"); + return rounding_driver (arg, divisor, floor, mpz_fdiv_q, floor2); } DEFUN ("round", Fround, Sround, 1, 2, 0, @@ -496,8 +495,7 @@ your machine. For example, (round 2.5) can return 3 on some systems, but 2 on others. */) (Lisp_Object arg, Lisp_Object divisor) { - return rounding_driver (arg, divisor, emacs_rint, rounddiv_q, round2, - "round"); + return rounding_driver (arg, divisor, emacs_rint, rounddiv_q, round2); } /* Since rounding_driver truncates anyway, no need to call 'trunc'. */ @@ -513,8 +511,7 @@ Rounds ARG toward zero. With optional DIVISOR, truncate ARG/DIVISOR. */) (Lisp_Object arg, Lisp_Object divisor) { - return rounding_driver (arg, divisor, identity, mpz_tdiv_q, truncate2, - "truncate"); + return rounding_driver (arg, divisor, identity, mpz_tdiv_q, truncate2); } |