Closed cosineblast closed 3 hours ago
Interesting. It looks like modulo arithmetic differs between programming languages.
I'd hesitate to create a breaking change where the behavior was changed unless there was sufficient reason to think one way is more correct than another. Not hesitation about adding a note in the docs though.
Feel free to open a PR for this. Thanks!
PS - Your profile pic is great btw! Took me a second to realize what it was :P
Feel free to open a PR for this. Thanks! Alright, no problem
PS - Your profile pic is great btw! Took me a second to realize what it was :P Thanks, I don't see toucans everyday (they usually show up in the morning), so I take pictures whenever I can.
The
BigInt.modBy m a
operation implemented in this library returns a negative value when the second argument is negative. However, one may assume by default that it behaves like the standard library version ofmodBy
, which always returns a non-negative integer in the range[0,m-1]
.I think it would be nice if the documentation for
BigInt.modBy
documented this behavior, or if it behaved like the standard library for theses cases.