These are chat archives for non/algebra

21st
Sep 2016
Denis Rosset
@denisrosset
Sep 21 2016 06:35
@larsrh, @tixxit, it's actually about the Double and Float instances in algebra (which we don't test!), and a mismatch between the behavior of quot/mod for algebra Rat and spire Rational.
The algebra Rat does the right thing: x % y = 0
This is consistent with the EuclideanRing laws. However, there is another modulo operation, which is defined on ordered rings. On integers, both definitions overlap, but not on fields nor on polynomial rings.
My PR is on the way. I'm actually working out the laws for this "other" modulo operation.
Denis Rosset
@denisrosset
Sep 21 2016 07:41
Okay, it's ready. See typelevel/algebra#172
Denis Rosset
@denisrosset
Sep 21 2016 07:46
Note: I'm talking only about the definition of quot/mod, which will have an impact later on gcd.
Denis Rosset
@denisrosset
Sep 21 2016 07:51
@non: the impact on Spire is that we use the syntax "%" for the mod operation on EuclideanRing. Then Rational(3) % Rational(2) = 0, which is not the current behavior.
Tom Switzer
@tixxit
Sep 21 2016 17:31
Thanks for digging into this! It'll be nice to have some clarity (and more laws) around this stuff
Erik Osheim
@non
Sep 21 2016 18:05
@denisrosset just added a comment -- i agree that we should rename the current mod/modulus to rem/remainder
Erik Osheim
@non
Sep 21 2016 18:10
@denisrosset also happy to talk here instead of github if that's easier
is there a reason that for Field[A] we must define quot(x, y) = div(x, y) ?
if so then you're right, the problem gets a little bit thornier.