Jerry James writes:
+2013-06-17 Jerry James <james(a)xemacs.org>
+
+ * internals/internals.texi (Numeric Types): New chapter describing
+ the implementation of bignums, ratios, and bigfloats.
Much appreciated!
+@item ratio
+Then @code{ratiop(x)} is false for all x. Any attempt to create a ratio
+causes an error to be raised. We would eventually like to define our
+own structure consisting of two @code{Lisp_Object}s, which are presumed
+to be integers (i.e., either fixnums or bignums).
I don't agree with this. If we really want ratios to always be
available, we should require one of the libraries, and bundle it if
necessary. But I'm not sure it's not more trouble than it's worth. I
agree that ratios are much more Lispy than floats, but really, given
that everybody has floats in hardware, aren't they good enough?
On second thought, doesn't calc already provide this?
+ We will do our own
+GCD calculation, which is bound to be slow, to keep the ratios reduced
+to canonical form.
If we do this, we can do this in C, and/or leave the choice of when to
do GCD to the application programmer.
+ We need a volunteer to perform this work.
Add it to the GSoC ideas list?
SXEmacs apparently supports a pile of other numeric libraries. Is it
worth asking for volunteers to add those?
+C code should use one of the following macros to create a Lisp integer,
+depending on the type of the C integer to be converted.
+@itemize @bullet
+@item
+@code{make_fixnum(x)} if x is guaranteed to fit into a Lisp fixnum.
This is an optimization?
+@item
+@code{make_integer(x)} if x is a signed C integer of any type.
+@item
+@code{make_unsigned_integer(x)} if x is an unsigned C integer of any type.
+@end itemize
I believe these make fixnums when possible. That should be noted here.
+@node GMP and MPIR driver, BSD MP driver, Abstract Numeric Interface, Numeric Types
+@section GMP driver
+@cindex gmp
+@cindex mpir
+
+The GNU Multiple Precision library (@uref{http://gmplib.org/}) and its
+fork, the Multiple Precision Integers and Rationals library
+(@uref{http://www.mpir.org/}), provide large integers, ratios, and
+floating point numbers. The same driver supports both GMP and MPIR,
Which library, if either, do you recommend? If the recommendation is
a strong preference, maybe it's worth noting here with your name and a
date attached. Something like
As of 2013-06-18, Jerry James (implementor of XEmacs extended
precision support) recommends use of a locally optimized MPIR
because it uses more accurate algorithms than GMP in a few cases,
and when both libraries are optimized for the platform MPIR is
(with a few exceptions) faster, up to 20% faster.
diff -r f6af091ac654 man/lispref/numbers.texi
--- a/man/lispref/numbers.texi Mon Jun 17 20:37:47 2013 +0100
+++ b/man/lispref/numbers.texi Mon Jun 17 15:37:12 2013 -0600
@@ -320,28 +320,29 @@
Looks good.
No comment on C sources, sorry!
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches