[MATRIX-SIG] integer division -- what a concept!

Rupert Mazzucco maz@pap.univie.ac.at
Sat, 17 Jan 1998 01:37:12 +0100 (MET)

On Fri, 16 Jan 1998, Zane Motteler wrote:
> If i and j are the same type, then the "principle of least surprise"
> says that x should be of the same type as i and j. If they are of
> different types, then the outcome of course depends on the rule
> of coercion, but generally one would expect x to be of the same
> type as either i or j. To me at least (and I've been in computing
> for 41 years now) it seems counterintuitive that the result of an
> operation would be of a different type than either operand.

It might seem you are somehow trapped by being a computer scientist
for a long time. I'm sure a beginner will find 1/2 == 0.5 less
surprising than 1/2 == 0, and the resulting different type
argument doesn't hold in a dynamically typed language.

Rupert Mazzucco 

MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org