Greetings!
Richard Fateman <fateman@cs.berkeley.edu> writes:
> test integer-decode-float on NaN, Infinity, etc.
> before you decide your program is correct. I think that
> such non-numbers should be "bigfloated" into symbols / gensyms
> with appropriate properties.
> e.g. NaN - NaN = NaN (not 0).
> Complicates matters!
> RJF
>
My understanding is that the Common Lisp spec is silent on an
implementation's treatment of Nan and Inf. If so, and we are
implicitly free to implement them in a useful way, I'd be happy to do
so for maxima's benefit. Paul, can we define NaN, and Inf as symbols
with floating point constant values, and 1/0, -1/0, and 0/0 as
analogous rationals? What would be useful rules regarding expressions
involving these symbols, beyond NaN - NaN = NaN et. al. mentioned
above?
Take care,
>
> Camm Maguire wrote:
>
> >Greetings!
> >
> >Raymond Toy <toy@rtp.ericsson.se> writes:
> >
> >
> >>>>>>>"Camm" == Camm Maguire <camm@enhanced.com> writes:
> >>>>>>>
> >> Camm> I don't think this is the case:
> >>
> >>My apologies. I didn't test it. I used to have problems with gcl's
> >>float reader/printer, but I guess you've fixed those. Nice!
> >>
> >> Camm> OK, will consider after Stavros gets a chance to look into things next
> >> Camm> week. Thanks again to all!
> >>
> >>FWIW, I ran your test function on cmucl. It passes the test case
> >>(test-f 1d0 10). Also, there were a couple of minor bugs. float
> >>should take the 2nd arg, otherwise it converts to single-float be
> >>default. This was messing up cmucl. :-)
> >>
> >>
> >
> >Thanks. Just a clarification here, this test also passes with GCL's
> >current rationalize, just not (yet) with the proposed improved one.
> >
> >Take care,
> >
> >
> >>(defun test-f (x i)
> >> (multiple-value-bind
> >> (q r s)
> >> (integer-decode-float x)
> >> (format t "~S~%" x)
> >> (and (eql x (float (* q (expt 2 r)) x))
> >> (eql (float (rationalize x) x) x)
> >> (if (> i 0)
> >> (test-f (float (* (+ q 1) (expt 2 r)) x) (- i 1))
> >> t))))
> >>
> >>Ray
> >>
> >>
> >>
> >>
> >>
> >
> >
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
--
Camm Maguire camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah