aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorPaul Eggert2019-08-24 12:43:50 -0700
committerPaul Eggert2019-08-24 15:55:08 -0700
commit575179f74d9b80ee468ae39239c853546da8de43 (patch)
treea91e8a8f05aec991d1040d56ef0eb59e446bcb55 /test/src
parentb62eac0f870754bc75b1162246f9901a04910044 (diff)
downloademacs-575179f74d9b80ee468ae39239c853546da8de43.tar.gz
emacs-575179f74d9b80ee468ae39239c853546da8de43.zip
Make (mod 1.0 0) consistent with (/ 1.0 0)
* src/data.c (Fmod): Do not signal an error for (mod 1.0 0), for the same reason (/ 1.0 0) does not signal an error. * test/src/data-tests.el (data-tests-mod-0): New test.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/data-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index a9d48e29a8a..3a7462b6ada 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -653,6 +653,13 @@ comparing the subr with a much slower lisp implementation."
653 (data-tests-check-sign (% -1 -3) (% nb1 nb3)) 653 (data-tests-check-sign (% -1 -3) (% nb1 nb3))
654 (data-tests-check-sign (mod -1 -3) (mod nb1 nb3)))) 654 (data-tests-check-sign (mod -1 -3) (mod nb1 nb3))))
655 655
656(ert-deftest data-tests-mod-0 ()
657 (dolist (num (list (1- most-negative-fixnum) -1 0 1
658 (1+ most-positive-fixnum)))
659 (should-error (mod num 0)))
660 (when (ignore-errors (/ 0.0 0))
661 (should (equal (abs (mod 0.0 0)) (abs (- 0.0 (/ 0.0 0)))))))
662
656(ert-deftest data-tests-ash-lsh () 663(ert-deftest data-tests-ash-lsh ()
657 (should (= (ash most-negative-fixnum 1) 664 (should (= (ash most-negative-fixnum 1)
658 (* most-negative-fixnum 2))) 665 (* most-negative-fixnum 2)))