[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: Richard Stallman
Subject: Re: Using the GNU GMP Library for Bignums in Emacs
Date: Sun, 22 Apr 2018 23:36:31 -0400

[[[ 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. ]]]

  >  From what I understand, we would want to use fixnums by default in the
  > C code, and convert to bignums automatically (in lisp) when the number
  > exceeds the range of a fixnum, while retaining behavior as before,
  > using the regular math operations + - * / (and more) to interface this
  > to Lisp.

Yes, exactly.

  > Would it not slow down computation to have to constantly convert
  > between the two types? (especially if the computation is switching
  > above/below the fixnum/bignum boundary). In such a case, a fix could
  > be to convert lisp numbers exceeding fixnum limits to bignums for the
  > rest of the number's life (until GC). This ensures memory usage is kept
  > low for fixnum computations.

I am not sure that makes sense.  Emacs works with numbers, and
computes (or otherwise generates) new numbers, but it never changes an
existing number.

Numbers that are in the range of non-bignum integers MUST be
represented as non-bignum integers so that the existing C code can
work on them without change.  Some places ought to be able to handle
larger numbers, and we will need to change them,  However, many places
could continue to handle only small numbers.

Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)
Skype: No way! See https://stallman.org/skype.html.

reply via email to

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