From: Samuele P. <ped...@bl...> - 2003-01-02 15:25:17
|
From: "Stefan Baramov" <Ste...@tr...> > Hello Jython Users > > First, Happy new year. > > Second, Can someone explain the following result: > > U:\>ver > > Microsoft Windows 2000 [Version 5.00.2195] > > U:\>jython > Jython 2.1 on java1.4.1 (JIT: null) > Type "copyright", "credits" or "license" for more information. > >>> 0.01 + 0.01 > 0.02 > >>> 0.01 + 1.01 > 1.02 > >>> 0.01 + 2.01 > 2.0199999999999996 > >>> 0.01 + 3.01 > 3.0199999999999996 > >>> > > I am especially interested why 0.01 + 2.01 comes up with such a weird > result. Is this a issue of the JVM or Jython? binary floating point: http://www.python.org/cgi-bin/faqw.py?req=show&file=faq04.098.htp |