Hardware or System Incompatibility

William O. Dargel wDargel at shoshana.com
Wed Feb 17 19:18:20 UTC 1999


Dan Ingalls wrote:

> B.  Secondly, Andres reports that
>                 0.0 raisedTo: 0.75 ==> -0.0 on his machine,
>         whereas I get 0.0 on my Mac.
>
>         If you get -0.0, please also supply the information requested above.

I already reported directly to Dan that I have this problem on Windows.
It seems to have started on the transition from version 1.31 to 2.0.
Based on some of the other messages here, I got interested in exploring
it a bit further.

I don't understand floating point representation, and so don't know what
to make of this. So I present the following results of printing
expressions in the context of Float in hopes that someone else will know
what to make of it.

(0.0 raisedTo: 0.75)                     -0.0
(0.0 raisedTo: 0.75) = NegativeInfinity  true
(0.0 raisedTo: 0.75) = NegativeZero      true
(0.0 raisedTo: 0.75) = Infinity          true
(0.0 raisedTo: 0.75) = NaN               true
(0.0 raisedTo: 0.75) = 1.2               true
NaN = Infinity          true
NaN = NegativeInfinity  true
NaN = NegativeZero      true
NaN = 1.2               true
NegativeZero = NegativeInfinity  false
Infinity = NegativeInfinity      false

(0.0 raisedTo: 0.75) hex 'FFF8000000000000'
NegativeInfinity hex     'FFF0000000000000'
NegativeZero hex         '8000000000000000'
Infinity hex             '7FF0000000000000'
NaN hex                  '7FF8000000000000'
1.2 hex                  '3FF3333333333333'

Ah, the -0.0 appears to be a 'negative' version of NaN. It really
surprises me though that NaN seems to be equal to _any_ Float value. 
Is that normal behavior?

I was going to check NaN behavior in 1.31, but it wasn't a class
variable back then.

-------------------------------------------
Bill Dargel            wdargel at shoshana.com
Shoshana Technologies
100 West Joy Road, Ann Arbor, MI 48105  USA





More information about the Squeak-dev mailing list