summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/lisp.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2024-07-04 14:46:54 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2024-07-04 15:32:45 +0200
commitf9f4f054bc15791ff63252e101dbf08bb4eb33c1 (patch)
tree54413cfb6d646fb526c82ea3f91fa207a34b1593 /lisp/emacs-lisp/lisp.el
parent565f4e4ad17c929159d646bfeff7d1adb4c9b727 (diff)
downloademacs-f9f4f054bc15791ff63252e101dbf08bb4eb33c1.tar.gz
emacs-f9f4f054bc15791ff63252e101dbf08bb4eb33c1.tar.bz2
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 'lisp/emacs-lisp/lisp.el')
0 files changed, 0 insertions, 0 deletions