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: Stefan Monnier
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sun, 22 Apr 2018 23:03:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> Surely we should just add bignum support to existing functions +, -,
>> etc.
> I'm not so sure of that.  E.g. (format "%x" -1) => "3fffffffffffffff".
> That doesn't make any sense on if -1 is a bignum.

Note that (format "%x" -1) does not necessarily use functions
in "+, -, etc..."

There are several steps to adding GMP support.  Some of those steps
might involve non-trivial decisions.  But the first few steps should be
straightforward enough:
A- add a new "bignum" type
B- add new operations on them (this might be enough to start using them in Calc)
C- add support for bignums to some of the pre-existing functions (e.g. +)
D- add support for bignums to more of the pre-existing functions
E- add support for bignums "everywhere" where numbers are usually allowed.

Anything before D/E should be fairly straightforward.
I consider "support for read&print" to fall somewhere in D or maybe E.


        Stefan




reply via email to

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