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: Paul Eggert
Subject: Re: integer overflow handling for most-negative-fixnum
Date: Sat, 21 Jul 2018 10:46:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Andy Moreton wrote:

Bignums are not relevant to this discussion.

I'm afraid they are. Whatever solution we come up with in this problem, should be compatible with bignums. Our solution should not assume that integers are of fixed width.

Non base10 representations
of emacs fixnums are not treated consistently, and prevent round trip
handling of the full range of valid fixnum values.

As Helmut mentioned, read and print work just fine. The problem is that if you use some formats, you don't get a round trip. Of course this problem is endemic to formats; e.g., (read (format "%g" X)) does not yield X for all floating-point values X, due to rounding. Still, it would be helpful if the usual kind of formatting hex integers were round-trip more often. I'll propose something along these lines in my next email.



reply via email to

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