diff options
| author | Paul Eggert | 2017-09-17 15:25:44 -0700 |
|---|---|---|
| committer | Paul Eggert | 2017-09-17 15:26:41 -0700 |
| commit | 5f28f0db73c03b98b27e04a458ebb209b5d9acde (patch) | |
| tree | 4c431e51e3e20d6b847907d014b1aea7754f34da /test/src | |
| parent | 37b5e661d298cbfe51422cd515b6696a1cdaa868 (diff) | |
| download | emacs-5f28f0db73c03b98b27e04a458ebb209b5d9acde.tar.gz emacs-5f28f0db73c03b98b27e04a458ebb209b5d9acde.zip | |
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')
| -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 @@ | |||
| 101 | (should (= 3 (apply #'min '(3 8 3)))) | 101 | (should (= 3 (apply #'min '(3 8 3)))) |
| 102 | (should-error (min 9 8 'foo)) | 102 | (should-error (min 9 8 'foo)) |
| 103 | (should-error (min (make-marker))) | 103 | (should-error (min (make-marker))) |
| 104 | (should (eql 1 (min (point-min-marker) 1)))) | 104 | (should (eql 1 (min (point-min-marker) 1))) |
| 105 | (should (isnan (min 0.0e+NaN))) | ||
| 106 | (should (isnan (min 0.0e+NaN 1 2))) | ||
| 107 | (should (isnan (min 1.0 0.0e+NaN))) | ||
| 108 | (should (isnan (min 1.0 0.0e+NaN 1.1)))) | ||
| 105 | 109 | ||
| 106 | ;; Bool vector tests. Compactly represent bool vectors as hex | 110 | ;; Bool vector tests. Compactly represent bool vectors as hex |
| 107 | ;; strings. | 111 | ;; strings. |