Re: [Jython-dev] (NaN == 111.0 ) returns 1 !
by Nicola de Candussio other posts by this author
Nov 18 2004 12:42PM messages near this date
[Jython-dev] (NaN == 111.0 ) returns 1 !
|
[Jython-dev] RE: [Jython-users] (NaN == 111.0 ) returns 1 !
Thank you very much for your inputs,
I did not understand if the current behaviour is considered a bug and
therefore will be fixed in one of the future releases.
Thanks again
Nicola de Candussio
Samuele Pedroni wrote:
> Nicola de Candussio wrote:
>
> > Dear all,
> >
> > could you tell me if the following code
> >
> > >>from java.lang import Math
> > >>g = Math.log(-1.0)
> > >>print (g==111.0)
> > 1
> >
> > highlights a bug or is an (un)expected behaviour of the rich comparison?
> >
>
> from the point of view of Python, comparisons with NaN,Inf etc are
> undefined. So doing that comparison is not portable in Python terms.
>
> OTOH it is indeed reasonable for Jython to behave as Java but notice
> that the problem is not with rich comparison but with the fact that
> floats don't implement all their flavors but just __cmp__.
>
> Moving away from implemnting just __cmp__ to rich comparisons is also
> what CPython did recently (in 2.4 timeframe), also in order to reflect
> the hosting C compiler behavior.
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Jython-dev mailing list
Jython-dev@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-dev
Thread:
Nicola de Candussio
Samuele Pedroni
Nicola de Candussio
Nicola de Candussio
|