Ar an triú lá de mí na Nollaig, scríobh Jerry James:
On Fri, Dec 3, 2010 at 9:46 AM, Samuel Bronson
<naesten(a)gmail.com> wrote:
> So, I guess bignums are guaranteed not to be representable as fixnums,
> then? That doesn't seem to be very clearly spelled out anywhere in
> (lispref), though things of that sort are mentioned in passing...
Hmmm, I guess you can blame that on me. I did the initial bignum
work, although Aidan has improved on that work quite a bit.
The lispref does say it, e.g. in (lispref)The Bignum Extension:
The XEmacs bignum facility implements the Common Lisp notions of
"canonicalization" and "contagion". Canonicalization means that in
exact (integer and ratio) arithmetic, a result of an operation is
always converted to the "smallest" type that can represent it exactly.
and, (lispref)Canonicalization and Contagion:
-- Function: canonicalize-number number
Return the canonical form of NUMBER.
However, if we've done our job properly, this is always a no-op.
That is, if you find a number in un-canonicalized form, please report
it as a bug.
That’s clear enough if you’re used to Common Lisp terminology, which I admit
many people aren’t.
Anyway, that's the way it has always been in Lisps that have
bignums.
The integer type is partitioned into the fixnum and bignum types.
Fixnums fit into a fixed amount of space, so that they can be operated
on efficiently (by a small number of CPU instructions). Bignums are
unbounded, but operations on them are less efficient.
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches