[SciPy-user] Representation of floating-point numbers

Nils Wagner nwagner at mecha.uni-stuttgart.de
Thu Jan 15 12:20:13 CST 2004


Hi all,

Python 2.3+ (#1, Sep 23 2003, 23:07:16)
[GCC 3.3.1 (SuSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 5.1
5.0999999999999996
>>>

What is the reason for this strange behavior ?

GNU Octave, version 2.1.49 (i686-pc-linux-gnu).
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 John W.
Eaton.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/help-wanted.html

Report bugs to <bug-octave at bevo.che.wisc.edu>.

octave:1> format long
octave:2> 5.1
ans = 5.10000000000000


Please can someone expand on the different behavior of python and
octave.

Nils



More information about the SciPy-user mailing list