[python-win32] Bug or Feature ??? working with floats under win32

Jim Vickroy Jim.Vickroy@noaa.gov
Tue, 07 Aug 2001 13:03:53 -0600


--------------1D2BE02AF6E2CCB57A38CB28
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi,

I'm unable to duplicate this behavior under Python 2.0 on a Win 2k
platform.

>>> f = 1.2345
>>> round(f,1)
1.2
>>> round(f,2)
1.23
>>>


Ulrich Eck wrote:

> Hi out there, I have this problem: >>> f = 4.23452345
> >>> round(f,1)
> 4.2000000000000002 under win32 using: PythonWin 2.1 (#15, Apr 16 2001,
> 18:25:49) [MSC 32 bit (Intel)] on win32.
> Portions Copyright 1994-2001 Mark Hammond (MarkH@ActiveState.com) -
> see 'Help/About PythonWin' for further copyright information.this
> version .. has anyone had this as well .. same works fine using
> python2.1 under linux:>>> f = 4.112345234
> >>> round(f,1)
> 4.1 thanks for your comments Ulrich Ecknet-labs

--------------1D2BE02AF6E2CCB57A38CB28
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body bgcolor="#FFFFFF">
Hi,
<p>I'm unable to duplicate this behavior under Python 2.0 on a Win 2k platform.
<p>>>> f = 1.2345
<br>>>> round(f,1)
<br>1.2
<br>>>> round(f,2)
<br>1.23
<br>>>>
<br>&nbsp;
<p>Ulrich Eck wrote:
<blockquote TYPE=CITE><style></style>
<font face="Arial"><font size=-1>Hi
out there,</font></font>&nbsp;<font face="Arial"><font size=-1>I have this
problem:</font></font>&nbsp;<font face="Arial"><font size=-1>>>> f = 4.23452345</font></font>
<br><font face="Arial"><font size=-1>>>> round(f,1)</font></font>
<br><font face="Arial"><font size=-1>4.2000000000000002</font></font>&nbsp;<font face="Arial"><font size=-1>under
win32 using:</font></font>&nbsp;<font face="Arial"><font size=-1>PythonWin
2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32.</font></font>
<br><font face="Arial"><font size=-1>Portions Copyright 1994-2001 Mark
Hammond (<a href="mailto:MarkH@ActiveState.com">MarkH@ActiveState.com</a>)
- see 'Help/About PythonWin' for further copyright information.</font></font><font face="Arial"><font size=-1>this
version ..</font></font>&nbsp;<font face="Arial"><font size=-1>has anyone
had this as well ..</font></font>&nbsp;<font face="Arial"><font size=-1>same
works fine using python2.1 under linux:</font></font><font face="Arial"><font size=-1>>>>
f = 4.112345234</font></font>
<br><font face="Arial"><font size=-1>>>> round(f,1)</font></font>
<br><font face="Arial"><font size=-1>4.1</font></font>&nbsp;<font face="Arial"><font size=-1>thanks
for your comments</font></font>&nbsp;<font face="Arial"><font size=-1>Ulrich
Eck</font></font><font face="Arial"><font size=-1>net-labs</font></font></blockquote>

</body>
</html>

--------------1D2BE02AF6E2CCB57A38CB28--