diff options
| author | Paul Eggert | 2018-09-13 14:28:56 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-09-13 14:29:58 -0700 |
| commit | c44bc4d370b38ac3e9da15579fd372d1410d4b4c (patch) | |
| tree | 5f294fabb278e1e294f35852086637e6df859ed8 /test/src/floatfns-tests.el | |
| parent | 755fa346eba212b4650c8541023bb78e1658d77b (diff) | |
| download | emacs-c44bc4d370b38ac3e9da15579fd372d1410d4b4c.tar.gz emacs-c44bc4d370b38ac3e9da15579fd372d1410d4b4c.zip | |
Fix (floor 54043195528445955 3.0) bug
* src/floatfns.c (rounding_driver): Fix rounding error
that can occur when both args have values exactly
representable as integers but at least one arg is a float.
* test/src/floatfns-tests.el (big-round): New test.
Diffstat (limited to 'test/src/floatfns-tests.el')
| -rw-r--r-- | test/src/floatfns-tests.el | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 3dcddc7f26b..14576b603c0 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -109,4 +109,8 @@ | |||
| 109 | (should-error (round n d)) | 109 | (should-error (round n d)) |
| 110 | (should-error (truncate n d))))))) | 110 | (should-error (truncate n d))))))) |
| 111 | 111 | ||
| 112 | (ert-deftest big-round () | ||
| 113 | (should (= (floor 54043195528445955 3) | ||
| 114 | (floor 54043195528445955 3.0)))) | ||
| 115 | |||
| 112 | (provide 'floatfns-tests) | 116 | (provide 'floatfns-tests) |