emacs-devel
[Top][All Lists]
Advanced

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

Re: Using the GNU GMP Library for Bignums in Emacs


From: Helmut Eller
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Thu, 03 May 2018 08:26:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Wed, May 02 2018, Paul Eggert wrote:

> Richard Stallman wrote:
>> That means the feature would need to specify the number of hex digits
>> desired.
>
> We already have such a feature. For example, (format "%09x" 257) returns
> "000000101", which is 257 hexadecimal, expressed using leading zeros
> as needed so that at least 9 digits are used. Once Emacs supports
> bignums, the same feature can print 40-hex-digit SHA-1 checksums by
> using (format "%040x" n).

I think the bitwise operations and the resulting negative numbers are
the problematic part:

E.g.

(format "%016x" (lognot 257)) => "3ffffffffffffefe"

but the 16-hex-digit string should be "fffffffffffffefe".

Helmut




reply via email to

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