This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Things I like about numbers (Re: Serious eq? bug?)


> From: Telford Tendys <telford@triangle.triode.net.au>
> 
> > Wow!  '-i is a number, while '-a, '-b, 'a, 'b and 'i are symbols.
> > And someone seriously calls it "good design"?!

Of course you are right!  We must replace -i with -j.

> All of scheme's numbers are a bit of a hack since they

        <very interesting examination of pathological cases>

> On the issue of (eq?), I find it strange that R4RS deliberately
> says that using (eq?) between two numbers produces an unspecified
> result depending in implementation. At least guile is in line
> with the standard there because two integers are correctly
> compared by (eq?) but two identical floats are not. I don't follow
> the note that it may not be possible to compare two numbers in
> finite time... does scheme support numerical formats that I
> don't understand?
> 

In a word, Yes.  But nobody understands all the numerical formats that
are supported, since many of them have not yet been invented.  Scheme
was designed to allow additional numeric types.  Some implementations[1]
represent real numbers as a delay'ed computation that can be force'd
to yield successively better approximations, others as algebraic
expressions (without variables, of course).  With these and other
representations you get a larger class of exact reals, or guaranteed
precision, but we know from theory that equality of reals is
undecidable in general.

[1] Possible implementations, that is.  Don't ask me whence to download.

Note that "float" does not occur in the R5RS index.  Suppose inexact
real numbers are represented as pointers to dynamically allocated
buffers that contain lots of bits.  If x and y are two pointers to
different buffers containing the same bits, and if eq? checks pointer
equality, then (not (eq? x y)).

-- 
     --Keith

This mail message sent by GNU emacs and Linux.
Food, Shelter, Source code.