[Top][All Lists]

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

Re: Using the GNU GMP Library for Bignums in Emacs

From: Eli Zaretskii
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sat, 21 Apr 2018 18:54:00 +0300

> Cc: address@hidden
> From: "Siraphob (Ben) Phipathananunth" <address@hidden>
> Date: Sat, 21 Apr 2018 22:40:05 +0700
> I thought that Eli was talking about how we should interface bignums
> to Emacs Lisp; the + - * / operators are defined in C source
> code.

I never thought we could consider not using + - * etc. with bignums,
so I didn't even raise that issue.

> Bignums would decrease performance in areas where the usual
> 32/64 bit integers are sufficient, and lead to higher memory usage. It
> would make much more sense to have separate math functions for 32/64
> bit numbers and for bignums. In doing so, it should be obvious to the
> Emacs Lisp programmer when to use what.

When the arguments are bignums, these operators should automatically
invoke the relevant GMP functions.  That is how we behave elsewhere in
Emacs; Emacs Lisp does support polymorphism on the level of primitive
functions.  E.g., that's how these operators support both Lisp
integers and Lisp floats (and markers, for that matter).

reply via email to

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