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 13:14:48 +0300

> From: Andy Moreton <address@hidden>
> Date: Sat, 21 Jul 2018 10:47:25 +0100
> 
> ELISP> most-negative-fixnum
> -2305843009213693952 (#o200000000000000000000, #x2000000000000000)
> ELISP> #x2000000000000000
> *** Read error ***  Arithmetic overflow error: "2000000000000000 (base 16) is 
> out of fixnum range; maybe set ‘read-integer-overflow-as-float’?"
> ELISP> #x-2000000000000000
> -2305843009213693952 (#o200000000000000000000, #x2000000000000000)
> 
> If the reader will not accept #x2000000000000000 as input then the value
> of most-negative-fixnum as a non base10 number octal should have
> negative sign to ensure consistent handling.

Please don't forget the important use case of showing the hex
representation of a negative number.  There are situations where I'd
like to have "M-: -10 RET" display #x3ffffffffffffff6 rather than
#x-0a.

So I'd prefer we fixed the reader, if that's possible without breaking
something important.



reply via email to

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