[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master f9f4f054bc1 1/2: Compare fixnums and floats accurately in val
From: |
Pip Cet |
Subject: |
Re: master f9f4f054bc1 1/2: Compare fixnums and floats accurately in value< |
Date: |
Thu, 04 Jul 2024 15:16:51 +0000 |
Hello Mattias,
On Thursday, July 4th, 2024 at 14:03, Mattias EngdegÄrd via Mailing list for
Emacs changes <emacs-diffs@gnu.org> wrote:
> 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.
Can you add a comment to fixnum_float_cmp explaining that it only works for
fixnums (62 / 30 bits), not for arbitrary EMACS_INTs (64 / 32 bits)? Or is that
totally obvious?
Pip
- Re: master f9f4f054bc1 1/2: Compare fixnums and floats accurately in value<,
Pip Cet <=