GCDRing implements a GCD ring.
For two elements x and y in a GCD ring, we can choose two elements d and m such that:
d = gcd(x, y)
m = lcm(x, y)
d * m = x * y
Additionally, we require:
gcd(0, 0) = 0
lcm(x, 0) = lcm(0, x) = 0
and commutativity:
gcd(x, y) = gcd(y, x)
lcm(x, y) = lcm(y, x)
- Companion
- object
Value members
Abstract methods
Inherited methods
- Definition Classes
- AdditiveCommutativeGroup -> AdditiveCommutativeMonoid -> AdditiveCommutativeSemigroup -> AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
- Inherited from
- AdditiveCommutativeGroup
Convert the given BigInt to an instance of A.
Convert the given BigInt to an instance of A.
This is equivalent to n
repeated summations of this ring's one
, or
-n
summations of -one
if n
is negative.
Most type class instances should consider overriding this method for performance reasons.
- Inherited from
- Ring
Convert the given integer to an instance of A.
Convert the given integer to an instance of A.
Defined to be equivalent to sumN(one, n)
.
That is, n
repeated summations of this ring's one
, or -n
summations of -one
if n
is negative.
Most type class instances should consider overriding this method for performance reasons.
- Inherited from
- Ring
- Definition Classes
- MultiplicativeCommutativeMonoid -> MultiplicativeCommutativeSemigroup -> MultiplicativeMonoid -> MultiplicativeSemigroup
- Inherited from
- MultiplicativeCommutativeMonoid
- Definition Classes
- MultiplicativeMonoid -> MultiplicativeSemigroup
- Inherited from
- MultiplicativeMonoid
Given a sequence of as
, compute the product.
Given a sequence of as
, compute the product.
- Inherited from
- MultiplicativeMonoid
Given a sequence of as
, compute the sum.
Given a sequence of as
, compute the sum.
- Inherited from
- AdditiveMonoid
- Definition Classes
- AdditiveGroup -> AdditiveMonoid -> AdditiveSemigroup
- Inherited from
- AdditiveGroup
- Definition Classes
- MultiplicativeMonoid -> MultiplicativeSemigroup
- Inherited from
- MultiplicativeMonoid