diff options
| author | Paul Eggert | 2018-09-04 11:49:41 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-09-04 11:50:54 -0700 |
| commit | 21637d5e5b29d5ec8fb966c0ddfbfba3eb33da38 (patch) | |
| tree | e0d7a0b9edac17b7fd6f7dc876e1ed97082dae0e /test/src/floatfns-tests.el | |
| parent | 628f6a2c7a9fe476b7e71efed3a8f8784a00cc54 (diff) | |
| download | emacs-21637d5e5b29d5ec8fb966c0ddfbfba3eb33da38.tar.gz emacs-21637d5e5b29d5ec8fb966c0ddfbfba3eb33da38.zip | |
Fix (round FLOAT BIGNUM) bug
* src/floatfns.c (rounding_driver): Fix bug when one
argument is a float and the other is a bignum.
* test/src/floatfns-tests.el (bignum-round): Test for the bug.
Diffstat (limited to 'test/src/floatfns-tests.el')
| -rw-r--r-- | test/src/floatfns-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index d41b08f7965..9a382058b43 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -70,6 +70,11 @@ | |||
| 70 | (should (= n (floor n))) | 70 | (should (= n (floor n))) |
| 71 | (should (= n (round n))) | 71 | (should (= n (round n))) |
| 72 | (should (= n (truncate n))) | 72 | (should (= n (truncate n))) |
| 73 | (let ((-n (- n)) | ||
| 74 | (f (float n)) | ||
| 75 | (-f (- (float n)))) | ||
| 76 | (should (= 1 (round n f) (round -n -f) (round f n) (round -f -n))) | ||
| 77 | (should (= -1 (round -n f) (round n -f) (round f -n) (round -f n)))) | ||
| 73 | (dolist (d ns) | 78 | (dolist (d ns) |
| 74 | (let ((q (/ n d)) | 79 | (let ((q (/ n d)) |
| 75 | (r (% n d)) | 80 | (r (% n d)) |