[Maxima] more three problems...
robert.dodier at gmail.com
Sat May 5 01:11:59 CDT 2007
On 5/4/07, Rainer Joswig <joswig at lisp.de> wrote:
> > > Result:
> > > [7.000000000000015E+19]
> > >
> > > This differed from the expected result:
> > > [7.0E+19]
Hmm. I would expect this test to succeed; there is a provision
in the testing code to look at only fpprintprec number of digits
(default fpprintprec = 12).
Try copying just this one test to a file, say foo.mac. Then try:
:lisp (trace batch-equal-check mstring)
batch ("foo.mac", test);
Does this shed some light on the problem?
Btw the relevant code is BATCH-EQUAL-CHECK in src/mload.lisp.
Yes, it is rather strange, now that I look at it...
> > Can you evaluate (in Lisp)
> > (+ (* 1d-20 (expt 1d20 2)) (* -5.5d0 1d20) 5.2d20)?
> > Does this produce 7d19 or something else?
5.2d0 is exactly representable as a double float.
What does (INTEGER-DECODE-FLOAT 5.2d0) return?
I think it should be (7934570312500000 16 1) because
7934570312500000 * 2^16 = 520000000000000000000.
I'm thinking maybe 5.2d20 causes trouble here because
5.2d<foo> is not exactly representable for some value of
<foo> ... just guessing here.
Thanks for your help,
More information about the Maxima