PEP0238 lament

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Mon Jul 23 11:56:30 EDT 2001


Mon, 23 Jul 2001 13:50:51 +0100, Steve Horne <sh at ttsoftware.co.uk> pisze:

> It's not a different operation on the same data. It's the same
> operation on a different datatype.

No, it's different operation on the same data, as long as we agree that
"same data" means "Python's '==' holds".
    3.0 == 3
    2.0 == 2
    3.0/2.0 != 3/2

> You might as well claim floating point addition is different from
> integer addition - that also requires a different algorithm and gives
> a different result.

They give the same result, except a very small rounding error
sometimes, and except where the integer addition doesn't give any
result because it overflows. If x and y are integers, then
float(x+y) == float(x)+float(y), with disclaimers above.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list