Use "quotient"? (was Re: proposed language change to int/int==float (was: PEP0238 lament))
Manoj Plakal
plakal-nospam at nospam-cs.wisc.edu
Thu Jul 26 04:15:17 EDT 2001
Manoj Plakal <plakal-nospam at nospam-cs.wisc.edu> wrote on Thursday 26 July
2001 02:55:
> - currently, the symbol `/' in Python programs signifies
> two different operators depending on the arguments:
> - the QUOTIENT operator with 2 integer arguments
>
> - the DIVISION operator with at least 1 float
> argument
>
> - the proposed change is to make '/' always signify the
> DIVISION operator and '//' always signify the QUOTIENT
> operator
Forgot to add that in the future, when we do unify ints and longs
and bring in rationals, then we again end up overloading the
'/' operator to mean two things:
- a constructor of rationals (with 2 integer arguments)
- the DIVISION operator (with at least 1 float argument)
Is this correct? Or maybe when we've unified everything into
a single number type, these will actually be the same thing:
you represent the number as a rational when you can and as
a real number otherwise. It's still "division".
I would be curious to know if other languages have a unified
number type (Scheme? Smalltalk?) and how they handle the
various operators and when to choose a certain representation
(rational vs real).
Manoj
More information about the Python-list
mailing list