Re: [Haskell-cafe] Re: Simple quirk in behavior of `mod`

22 Jul
2009
22 Jul
'09
10:23 a.m.
Thomas ten Cate schrieb:
There are two ways of looking at the mod operator (on integers):
1. As a map from the integers Z to Z/pZ. [...] 2. As the remainder under division by p. Since n mod 0 would be the remainder under division by 0, this correctly gives a division by zero error.
I used to think that the definitions were equivalent... apparently not.
They are if you don't disallow division by zero with remainder. Namely, the definition of “division with remainder” works as in (1).
5783
Age (days ago)
5783
Last active (days ago)
0 comments
1 participants
participants (1)
-
Kalman Noel