[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>
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/05/01
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/05/02
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/05/03
- Re: Using the GNU GMP Library for Bignums in Emacs, Helmut Eller, 2018/05/03
- Re: Using the GNU GMP Library for Bignums in Emacs, Eli Zaretskii, 2018/05/03
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/05/03
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/05/04
- Re: Using the GNU GMP Library for Bignums in Emacs,
Ken Raeburn <=
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/05/05
- Re: Using the GNU GMP Library for Bignums in Emacs, Ken Raeburn, 2018/05/07
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/05/07
- Re: Using the GNU GMP Library for Bignums in Emacs, Andreas Schwab, 2018/05/07
- Re: Using the GNU GMP Library for Bignums in Emacs, Helmut Eller, 2018/05/03
- Message not available
- Re: Using the GNU GMP Library for Bignums in Emacs, Helmut Eller, 2018/05/03
- Re: Using the GNU GMP Library for Bignums in Emacs, Paul Eggert, 2018/05/03
- Re: Using the GNU GMP Library for Bignums in Emacs, Richard Stallman, 2018/05/04