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.
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)
>> 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.