diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-09-17 15:25:44 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-09-17 15:26:41 -0700 |
commit | 5f28f0db73c03b98b27e04a458ebb209b5d9acde (patch) | |
tree | 4c431e51e3e20d6b847907d014b1aea7754f34da /test/src/data-tests.el | |
parent | 37b5e661d298cbfe51422cd515b6696a1cdaa868 (diff) | |
download | emacs-5f28f0db73c03b98b27e04a458ebb209b5d9acde.tar.gz |
Fix bug with min and max and NaNs
* src/data.c (minmax_driver): Fix bug with (min 0 NaN), which
mistakenly yielded 0. Also, pacify GCC in a better way.
* test/src/data-tests.el (data-tests-min): Test for the bug.
Diffstat (limited to 'test/src/data-tests.el')
-rw-r--r-- | test/src/data-tests.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el index 5dc26348a6f..8de8c145d40 100644 --- a/test/src/data-tests.el +++ b/test/src/data-tests.el @@ -101,7 +101,11 @@ (should (= 3 (apply #'min '(3 8 3)))) (should-error (min 9 8 'foo)) (should-error (min (make-marker))) - (should (eql 1 (min (point-min-marker) 1)))) + (should (eql 1 (min (point-min-marker) 1))) + (should (isnan (min 0.0e+NaN))) + (should (isnan (min 0.0e+NaN 1 2))) + (should (isnan (min 1.0 0.0e+NaN))) + (should (isnan (min 1.0 0.0e+NaN 1.1)))) ;; Bool vector tests. Compactly represent bool vectors as hex ;; strings. |