Hacker News new | ask | show | jobs
by lmm 702 days ago
> When performing integer "division" of x by y, you're finding a solution {q,r} to the equation y * q = x - r. When y=0 any choice of q works, and using 0,x is a perfectly reasonable and intuitive way of defining things.

Nope. You forgot that there's a requirement that r < q. Otherwise I could say e.g. 5/2 = 1, which is certainly no less valid than saying that 5/0 = 0, but not something that anyone sane wants.

1 comments

I think not, because in the y=0 case the only sensible r is x, because remove the mod 0 subset you have the unmodified set of integers itself-- the remainder can only sensibly be an identity in that case.
> in the y=0 case the only sensible r is x

No, x is an utterly non-sensible value of r.

> remove the mod 0 subset you have the unmodified set of integers itself-- the remainder can only sensibly be an identity in that case.

What are you talking about? There are no possible remainders mod 0 (just as there is one possible remainder mod 1 and there are 2 possible remainders mod 2) and there is no sensible definition of the remainder function; defining it to be identity is no less silly than defining it to be, IDK, 7.