[IronPython] Floating-point number don't compare correctly
hao.yu
hao.yu at yeah.net
Sat Jun 9 19:25:35 PDT 2007
Test the following lines under IronPython 1.1:
import System
intVar = System.Int32.Parsse("400")
floatVar = System.Single.Parse("400")
doubleVar = System.Double.Parse("400")
intVar>500, floatVar>500, doubleVar>500
=> (False, True, False)
It seemed that float number type compare incorrectly with int numbers. If I change the expression to
floatVar>500.0
the result is False (as expected).
Why this behaviour?
More information about the users
mailing list