diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/floatfns-tests.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/src/floatfns-tests.el b/test/src/floatfns-tests.el index 14576b603c0..61b1c25743d 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -35,6 +35,12 @@ | |||
| 35 | (should-error (fround 0) :type 'wrong-type-argument)) | 35 | (should-error (fround 0) :type 'wrong-type-argument)) |
| 36 | 36 | ||
| 37 | (ert-deftest bignum-to-float () | 37 | (ert-deftest bignum-to-float () |
| 38 | ;; 122 because we want to go as big as possible to provoke a rounding error, | ||
| 39 | ;; but not too big: 2**122 < 10**37 < 2**123, and the C standard says | ||
| 40 | ;; 10**37 <= DBL_MAX so 2**122 cannot overflow as a double. | ||
| 41 | (let ((a (1- (ash 1 122)))) | ||
| 42 | (should (or (eql a (1- (floor (float a)))) | ||
| 43 | (eql a (floor (float a)))))) | ||
| 38 | (should (eql (float (+ most-positive-fixnum 1)) | 44 | (should (eql (float (+ most-positive-fixnum 1)) |
| 39 | (+ (float most-positive-fixnum) 1)))) | 45 | (+ (float most-positive-fixnum) 1)))) |
| 40 | 46 | ||