diff options
| author | Mattias EngdegÄrd | 2024-07-04 14:46:54 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2024-07-04 15:32:45 +0200 |
| commit | f9f4f054bc15791ff63252e101dbf08bb4eb33c1 (patch) | |
| tree | 54413cfb6d646fb526c82ea3f91fa207a34b1593 /java/org/gnu | |
| parent | 565f4e4ad17c929159d646bfeff7d1adb4c9b727 (diff) | |
| download | emacs-f9f4f054bc15791ff63252e101dbf08bb4eb33c1.tar.gz emacs-f9f4f054bc15791ff63252e101dbf08bb4eb33c1.zip | |
Compare fixnums and floats accurately in value<
Make `value<` compare fixnums and floats by value, as `<` does, instead
of coercing the fixnum to a float first which is what C would do.
This matters when the fixnum cannot be represented as a float. For
example, C would evaluate
72057594037927935 < 72057594037927936.0
to false since the operands are converted to the same floating-point
number.
* src/fns.c (fixnum_float_cmp): New.
(value_cmp): Use it.
* test/src/fns-tests.el (fns-value<-ordered, fns-value<-unordered):
New test cases.
Diffstat (limited to 'java/org/gnu')
0 files changed, 0 insertions, 0 deletions