I don't quite get your meaning, but maybe this is clearer:
Jython 2.1 on java1.3.1_01 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> from java.lang.Float import NaN
>>> NaN =3D=3D 1
From the JLS:
"NaN is unordered, so the numerical comparison operators <, <=3D, >, and =
>=3D return false if either or both operands are NaN (=A715.20.1). The=20
equality operator =3D=3D returns false if either operand is NaN, and the =
inequality operator !=3D returns true if either operand is NaN =
In particular, x!=3Dx is true if and only if x is NaN, and (x<y) =3D=3D =
will be false if x or y is NaN."
a.k.a. Bug, IMHO.
From: On Behalf Of Widhalm, Eric
Sent: Monday, November 15, 2004 10:32 AM
Subject: RE: [Jython-users] (NaN =3D=3D 111.0 ) returns 1 !
> could you tell me if the following code
> >>from java.lang import Math
> >>g =3D Math.log(-1.0)
> >>print (g=3D=3D111.0)
> highlights a bug or is an (un)expected behaviour of the rich
Nicola, the return value will either be 0 or 1, representing boolean =
values true or false. In this case, -1 is !=3D 111.0, so you get back 1, =