diff options
| author | Tom Tromey | 2018-07-05 13:17:36 -0600 |
|---|---|---|
| committer | Tom Tromey | 2018-07-12 22:12:27 -0600 |
| commit | 872faabbd8cb0f5518777b2d4fe7de187f684a92 (patch) | |
| tree | b09cc3fa24e232c156f7991008d080fd5c77d860 /test/src | |
| parent | d14808cd271abf6a723bf495a6a01c14d18b5893 (diff) | |
| download | emacs-872faabbd8cb0f5518777b2d4fe7de187f684a92.tar.gz emacs-872faabbd8cb0f5518777b2d4fe7de187f684a92.zip | |
Allow conversion of bignums to floats
* src/floatfns.c (extract_float, Ffloat): Handle bignums.
* src/lisp.h (XFLOATINT): Handle bignums.
* test/src/floatfns-tests.el (bignum-to-float): New test.
Diffstat (limited to 'test/src')
| -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 cb173eea76d..c87445b6bd2 100644 --- a/test/src/floatfns-tests.el +++ b/test/src/floatfns-tests.el | |||
| @@ -34,4 +34,8 @@ | |||
| 34 | (should-error (ftruncate 0) :type 'wrong-type-argument) | 34 | (should-error (ftruncate 0) :type 'wrong-type-argument) |
| 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 () | ||
| 38 | (should (eql (float (+ most-positive-fixnum 1)) | ||
| 39 | (+ (float most-positive-fixnum) 1)))) | ||
| 40 | |||
| 37 | (provide 'floatfns-tests) | 41 | (provide 'floatfns-tests) |