From: Paul Eggert Date: Sat, 22 Sep 2018 06:08:52 +0000 (-0700) Subject: Fix (+ bignum float) bug X-Git-Tag: emacs-27.0.90~4389 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3727bc7d599c24715a66de3e899a82b6f07d1aac;p=emacs.git Fix (+ bignum float) bug * src/data.c (bignum_arith_driver): Fix typo: missing ‘return’. * test/src/data-tests.el (data-tests-bignum): Test for the typo. --- diff --git a/src/data.c b/src/data.c index 1e97d9efa15..cc080372d8b 100644 --- a/src/data.c +++ b/src/data.c @@ -2920,8 +2920,8 @@ bignum_arith_driver (enum arithop code, ptrdiff_t nargs, Lisp_Object *args, val = args[argnum]; CHECK_NUMBER_COERCE_MARKER (val); if (FLOATP (val)) - float_arith_driver (code, nargs, args, argnum, - mpz_get_d (*accum), val); + return float_arith_driver (code, nargs, args, argnum, + mpz_get_d (*accum), val); } } diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 701e579ae2e..3cd4802a981 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -547,6 +547,16 @@ comparing the subr with a much slower lisp implementation." (should (<= b-1 b0)) (should (<= b-1 b-1)) + (should (= (+ f0 b0) (+ b0 f0))) + (should (= (+ f0 b-1) (+ b-1 f0))) + (should (= (+ f-1 b0) (+ b0 f-1))) + (should (= (+ f-1 b-1) (+ b-1 f-1))) + + (should (= (* f0 b0) (* b0 f0))) + (should (= (* f0 b-1) (* b-1 f0))) + (should (= (* f-1 b0) (* b0 f-1))) + (should (= (* f-1 b-1) (* b-1 f-1))) + (should (= b0 f0)) (should (= b0 b0))