diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2018-08-18 23:27:47 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-08-18 23:29:16 -0700 |
commit | 06b5bcd639bf97fc77dc89dd52f136d4f262e888 (patch) | |
tree | 4533e24794585504e3c5fce20f00fb873f1a0235 /src/floatfns.c | |
parent | 351859238d8b72c514f6714bd0f6b4dd39941606 (diff) | |
download | emacs-06b5bcd639bf97fc77dc89dd52f136d4f262e888.tar.gz emacs-06b5bcd639bf97fc77dc89dd52f136d4f262e888.tar.bz2 emacs-06b5bcd639bf97fc77dc89dd52f136d4f262e888.zip |
Fix bug with ‘mod’ and float+bignum
Problem reported by Andy Moreton in:
https://lists.gnu.org/r/emacs-devel/2018-08/msg00442.html
* src/floatfns.c (fmod_float): Work even if an arg is a bignum.
* test/src/floatfns-tests.el (bignum-mod): New test.
Diffstat (limited to 'src/floatfns.c')
-rw-r--r-- | src/floatfns.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/floatfns.c b/src/floatfns.c index ea2eb1016b1..713d42694ff 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -514,10 +514,8 @@ With optional DIVISOR, truncate ARG/DIVISOR. */) Lisp_Object fmod_float (Lisp_Object x, Lisp_Object y) { - double f1, f2; - - f1 = FLOATP (x) ? XFLOAT_DATA (x) : XFIXNUM (x); - f2 = FLOATP (y) ? XFLOAT_DATA (y) : XFIXNUM (y); + double f1 = XFLOATINT (x); + double f2 = XFLOATINT (y); f1 = fmod (f1, f2); |