all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master f9f4f054bc1 1/2: Compare fixnums and floats accurately in value<
       [not found] ` <20240704140356.A5E1AC1FB68@vcs2.savannah.gnu.org>
@ 2024-07-04 15:16   ` Pip Cet
  2024-07-04 15:51     ` Mattias Engdegård
  0 siblings, 1 reply; 2+ messages in thread
From: Pip Cet @ 2024-07-04 15:16 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Emacs Devel

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: master f9f4f054bc1 1/2: Compare fixnums and floats accurately in value<
  2024-07-04 15:16   ` master f9f4f054bc1 1/2: Compare fixnums and floats accurately in value< Pip Cet
@ 2024-07-04 15:51     ` Mattias Engdegård
  0 siblings, 0 replies; 2+ messages in thread
From: Mattias Engdegård @ 2024-07-04 15:51 UTC (permalink / raw)
  To: Pip Cet; +Cc: Emacs Devel

4 juli 2024 kl. 17.16 skrev Pip Cet <pipcet@protonmail.com>:

> 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?

Sometimes we need to state the totally obvious! The comment is now a bit more helpful.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-04 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <172010183615.2930.8557271862854647404@vcs2.savannah.gnu.org>
     [not found] ` <20240704140356.A5E1AC1FB68@vcs2.savannah.gnu.org>
2024-07-04 15:16   ` master f9f4f054bc1 1/2: Compare fixnums and floats accurately in value< Pip Cet
2024-07-04 15:51     ` Mattias Engdegård

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.