ebzzry / ebzzry.github.io

Creative Commons Zero v1.0 Universal
8 stars 3 forks source link

Division in Haskell clarification #6

Closed Kiwi closed 5 years ago

Kiwi commented 5 years ago

Currently in the English version (I don't know what it says in Esperanto I assume it's about the same... :) ) there's this point

I think it's only true in a `mod` b if abs a <= abs b && a /= 0 && b /= 0 (or something like that)

So while the statement holds here

> mod 5 (-13)
-8
> mod (-5) 13
8

it doesn't here

> mod 13 (-5)
-2
> mod (-13) 5
2

or here

> mod 0 (-5)
0
> mod (-5) 0
*** Exception: divide by zero

obviously.

Some people thus found the statement misleading. I don't know if you want to elaborate on it? Thanks for taking the time to write it up in the first place. I like your website.

EN source EO source Division in Haskell

ebzzry commented 5 years ago

Sorry for the late reply—this issue got burried quickly and didn’t notice it.

Thanks for pointing out that source of confusion. In response to that, I have already updated both the English and Esperanto versions of the article, with the clarifications.