# [MATRIX-SIG] Re: int. division

Charles G. Waldman cgw@pgt.com
Sat, 17 Jan 98 13:31 EST

```David J. C. Beach writes:
>
> Allow me to reiterate Paul Dubois's argument.  Consider the code:
>
>             x = i / j
>
> Now, suppose i=2 and j=4.  Then x will be the integer, 2.  Everybody agrees
> on this.

Well, not everybody.  I would have 2/4 == 2.0 and 2//4 == 2

I think these are different mathematical operations; in one view,
division is an "inverse operation" to multiplication, just as
subtraction is the inverse operation to addition; just as

(-B) + A + B == A for all A and B

I expect

(1/B) * A*B == A for all nonzero B

[at least up to the limits of machine representation of real numbers]

In the other view,  division is the solution of the equation

xa + r = b, r<b

for an integer x, given integers a and b.

Both of these are useful notions and I'm not proposing we take any
feature out of the language, I would simply acknowledge that these two
are not the same operation and distinguish them with different
symbols.

_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org