More revisions for numbers.texi
Stephen J. Turnbull
stephen at xemacs.org
Sat May 22 01:30:03 EDT 2004
>>>>> "Jerry" == Jerry James <james at xemacs.org> writes:
>> precision. Can we extend `coerce'?
Jerry> Sure. How does (coerce f '(bigfloat 500)) grab you?
That was _my_ first thought, too. But that suggests (quite strongly
to me, YMMV) that '(bigfloat 500) is a type. If so,
(eql (coerce 1 '(bigfloat 500)) (coerce 1 '(bigfloat 1000)))
should return `nil'. If bigfloat isn't a type, that should be spelled
(defun coerce (object type &optional precision) ...)
but I really don't like that, we've got the whisker twitching the cat
here.
Re: initialization of bigfloat-maximum-precision:
Jerry> I've been running with Olivier's patch with no problem for
Jerry> awhile now. I think we should just have him commit it and
Jerry> start using it.
Great!
>> (5) Shouldn't `bigfloat-max-prec' be a constant (see the
>> declaration of `most-positive-fixnum')?
Jerry> Uh ... what makes you think it isn't a constant?
Excuse me while I get this honkin' big plank out of my eye. Now, what
was the question? :-P
Jerry> Oops, no, I've misled you again. If
Jerry> default-float-precision is zero, then floats are created.
Jerry> If it is nonzero, then bigfloats of the indicated precision
Jerry> (or thereabouts) are created. I've changed the docstring
Jerry> to make this clearer.
I understood that part, but doesn't it also magically change the
_library_'s default precision?
Jerry> I don't understand. This works exactly the way I expect it
Jerry> to work, which apparently means that we have different
Jerry> expectations. The eql test says that the numbers are the
Jerry> same type and have the same value. Float and bigfloat are
Jerry> different types, so eql will always fail.
Yes. My question is whether '(bigfloat 500) and '(bigfloat 1000) are
different types. The fact that they have the same internal
implementation as a C struct is irrelevant; I believe the same is true
of markers and extents, for example (that's based on a comment in the
Internals Manual, so who knows if it's true now or ever actually was
;-).
The fact that float has an immediate representation is irrelevant as
well (at least, I think so and you argued that for fixnums and
bignunms when I was talking about floating slash rationals), so to be
consistent eql should consider every floatingp number to have the same
type, or should distinguish any pair that have different precision.
Do you see what I'm getting at now?
--
Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.
More information about the XEmacs-Beta
mailing list