-
Notifications
You must be signed in to change notification settings - Fork 93
Division #154
Comments
I agree. My current thinking is that Also, I think
|
Edit: I support the proposal, see the next comments that point out my previous misunderstanding of the terms. Below is my original comment. My opinion is that integer division I believe @treeowl refers to this as Knuthian division, but I'm not sure why -- as far as I know this is a commonly accepted definition in mathematics. Many programming languages get it wrong though. Also |
No, that's what I called Euclidean. Knuthian is the Prelude div/mod. On Nov 19, 2016 4:03 PM, "Andrey Mokhov" [email protected] wrote:
|
@treeowl Ah, I'm sorry, my mistake. To my embarrassment I didn't realise that Knuth's definition was different from the standard mathematical one, which apparently is referred to as Euclidean :-) I fully support your proposal: the Euclidean division should be the default/easiest to write. |
There's no division currently in prelude that guarantee a positive remainder. I think it would make sense to define use-case i.e. what does it mean when The only thing everyone agree and is a given is:
@snowleopard: |
The Prelude erred, I believe, in offering machine division (
quotRem
) and Knuthian division (divMod
) as the standard division operations. I think we want to keep Knuthian division around for the situations where it's appropriate, but give a very nice name to "Euclidean" division, which guarantees a non-negative remainder.The text was updated successfully, but these errors were encountered: