more three problems...



In article 
<eb9c4b9a0705042311i136d68dfq13102a094ccd96a0 at mail.gmail.com>,
 "Robert Dodier" <robert.dodier at gmail.com> wrote:

> 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?

I'll check that later today.

> 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?
> >
> > 7.000000000000013E19
> 
> 5.2d0 is exactly representable as a double float.
> What does (INTEGER-DECODE-FLOAT 5.2d0) return?

MAXIMA 17 > (INTEGER-DECODE-FLOAT 5.2d0)
5854679515581645
-50
1
> 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,
> Robert

-- 
http://lispm.dyndns.org