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: Paul Eggert
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sat, 21 Apr 2018 08:23:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

Siraphob (Ben) Phipathananunth wrote:
One approach would be to implement a minimal subset of functions
exposed in Emacs Lisp that would allow one to recreate the following
functions that are defined in calc.el :

Surely we should just add bignum support to existing functions +, -, etc. Wouldn't that suffice for 'calc'? If not, why not? (Of course 'calc' would need to be changed to exploit the bignums properly, no matter how we add bignums.)

With respect to floating points, though, things get a little hairy.

This should be a separate task. Bignums alone are quite a large-enough project. I'm not even sure we should do rationals.

The /actual/ value of the bignum
(internally, in C) would be a tagged pointer to the mpz_t data type
stored somewhere so that it could be marked for GC

For bignums I would think that Emacs shouldn't use the mpz_t data type, as this would complicate garbage collection. Emacs can use the mp_limb_t data type and stick with the mpn_* functions.



reply via email to

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