[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] Re: [Maxima] float to bfloat

From: Richard Fateman
Subject: Re: [Gcl-devel] Re: [Maxima] float to bfloat
Date: Mon, 26 Jan 2004 08:21:05 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

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!

Camm Maguire wrote:


Raymond Toy <address@hidden> writes:

"Camm" == Camm Maguire <address@hidden> 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)
     (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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]