proposed language change to int/int==float (was: PEP0238 lament)

Grant Edwards grante at visi.com
Thu Jul 26 13:47:34 EDT 2001


In article <cpitgf7itx.fsf at cj20424-a.reston1.va.home.com>, Guido van Rossum wrote:
>grante at visi.com (Grant Edwards) writes:
>
>> >The important thing is that i//j will return the same value
>> >regardless if i and j ar ints or floats; ditto for the new i/j.
>> 
>> If that's important, why won't the other math operators do it???
>
>Huh?  They do (apart from unavoidable round-off errors).  1+2 == 1.0+2.0.

They compare equal with the "==" operator, but they are not
the same value:

>>> 1+2
3
>>> 1.0+2.0
3.0
>>> 

... unless 3 and 3.0 are "the same value".  In which case my
definition of that phrase is merely different than yours.

-- 
Grant Edwards                   grante             Yow!  I wonder if I ought
                                  at               to tell them about my
                               visi.com            PREVIOUS LIFE as a COMPLETE
                                                   STRANGER?



More information about the Python-list mailing list