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

Re: weird math



In message <ogSyAUS00WBO89I3Jn@andrew.cmu.edu> Steven Ritter writes:
> According to my reading of CLtL2 (292-293), this should not happen:
> ? (= 1.4 (/ 7 5))
> NIL
> 
> Especially since:
> ? (= 1.4 (coerce (/ 7 5) 'float))
> T
> 
> This isn't a general bug because:
> ? (= 1.5 (/ 3 2))
> T
> 
> This is the kind of bug that can shake your faith in the truth and
> purity of mathematics.
> 
> I'm using MCL 2.0p2
> 
> Steve

I tried your three statements in Lucid Common Lisp (Sun) and got
*exactly* the same results.

In spite of the "correctness" of Lisps behavior with respect to
the language definition (as pointed out in Bill's response),
to the programmer this looks really weird.

Never compare numbers except you know they are integers?!?
What does Mathematica return here?

Greetings                                        rm