diff options
| -rw-r--r-- | src/floatfns.c | 6 | ||||
| -rw-r--r-- | test/src/floatfns-tests.el | 3 |
2 files changed, 5 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. */) | |||
| 514 | Lisp_Object | 514 | Lisp_Object |
| 515 | fmod_float (Lisp_Object x, Lisp_Object y) | 515 | fmod_float (Lisp_Object x, Lisp_Object y) |
| 516 | { | 516 | { |
| 517 | double f1, f2; | 517 | double f1 = XFLOATINT (x); |
| 518 | 518 | double f2 = XFLOATINT (y); | |
| 519 | f1 = FLOATP (x) ? XFLOAT_DATA (x) : XFIXNUM (x); | ||
| 520 | f2 = FLOATP (y) ? XFLOAT_DATA (y) : XFIXNUM (y); | ||
| 521 | 519 | ||
| 522 | f1 = fmod (f1, f2); | 520 | f1 = fmod (f1, f2); |
| 523 | 521 | ||
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 7714c05d60a..43a2e278290 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -46,4 +46,7 @@ | |||
| 46 | (should (= (+ (logb most-positive-fixnum) 1) | 46 | (should (= (+ (logb most-positive-fixnum) 1) |
| 47 | (logb (+ most-positive-fixnum 1))))) | 47 | (logb (+ most-positive-fixnum 1))))) |
| 48 | 48 | ||
| 49 | (ert-deftest bignum-mod () | ||
| 50 | (should (= 0 (mod (1+ most-positive-fixnum) 2.0)))) | ||
| 51 | |||
| 49 | (provide 'floatfns-tests) | 52 | (provide 'floatfns-tests) |