Implement euclidean division and remainder#2678
Conversation
|
What exactly does this add over quo and rem? |
|
I think the advantage is that this is integer based? Does it make a difference knowing the cost of eval will be higher than that of the float operation(s)? |
These are different operations:
Euclidean division and remainder are used in a few algorithms. |
I'm fully aware what the euclidean algorithm is, but the only difference here is that rem will return a negative representative for negative numbers. Having both seems redundant, when it's straight-forward to translate between the two. |
While that is true, I think the extra bit of convenience for a relatively common mathematical operation is worth it. I consider it similar to functions like |
|
It's always hard to draw the line what's in and out of scope with things like this (and math text operators). Here's the relevant discussion for Rust as a reference: rust-lang/rfcs#2169 |
|
Whatever, I don't mind too much either way. Thanks! |
While the issue #2677 that prompted me to implement these functions has been solved already, Euclidean division and remainder still seem like sensible additions to me.
I'm not sure if I like the documentation, but to me, it appears surprisingly hard to describe these functions in a precise and succinct manner.