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: Ken Raeburn
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sat, 5 May 2018 01:03:30 -0400

On May 4, 2018, at 00:26, Richard Stallman <address@hidden> wrote:
> 
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
> I don't think people want (format "%x" (lognot 257)) to output "-102".
> Not on any platform.  It isn't what code expects, and it isn't useful.
> 
> Perhaps, with bignums,  lognot  should take a width operand, measured in bits.
> So (lognot 257 32) would produce 0xfffffefe (a positive number)
> and (lognot 257 64) would produce 0xfffffffffffffefe (a positive number).
> 
> Another idea: %Nx with a negative number should output its 2's
> complement representation in 4N bits.

That's already taken: A leading “-“ means to left-justify the output if the 
specified width is wider than required.

ELISP> (format "%-16x" 300)
"12c             "
ELISP> (format "%16x" 300)
"             12c"
ELISP> 




reply via email to

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