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: Stefan Monnier
Subject: Re: integer overflow handling for most-negative-fixnum
Date: Sat, 21 Jul 2018 14:12:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> How about this idea. First, we extend 'format' to support bitwidth modifiers
> for twos-complement representation. For example, (format "%/24x" -1) would
> format just the low-order 24 bits of the integer, and would return "ffffff"
> regardless of machine word size or whether bignums are used.
>
> Second, we change (format "%x" -1) to return "-1" rather
> than a machine-dependent string like "3fffffffffffffff" as it does now.  That
> would make Elisp be more machine-independent, would solve Andy's problem,
> and would solve other problems once we have bignums, and in hindsight it's
> what we should have done originally. However, it would be an incompatible
> change, so let's have the behavior depend on a compatibility variable, much
> as we already do for read-integer-overflow-as-float.

Sounds great to me,


        Stefan



reply via email to

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