emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: integer overflow handling for most-negative-fixnum


From: Eli Zaretskii
Subject: Re: integer overflow handling for most-negative-fixnum
Date: Sat, 21 Jul 2018 21:51:09 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Sat, 21 Jul 2018 14:42:32 -0400
> 
> > Yes.  More importantly, I'd like it to read #x3fffffffffffffff as -1.
> 
> Hmm... me don't like that at all.
> 
> >> When/why/where would that be a good idea?
> > When wouldn't it be a good idea?
> 
> When the user wrote #x3fffffffffffffff to mean "the positive number
> written as 3fffffffffffffff in hexadecimal"

There's no such positive number, at least not as fixnum.

> You can only read it as "-1" based on an assumption of fixed-width
> two's-complement representation but the bitwidth of Emacs numbers is
> something that can change between Emacs versions and
> compilation options.

I'm talking about an Emacs with 64-bit EMACS_INT.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]