Ring consists of:
Ring consists of:
- a commutative group for addition (+)
- a monoid for multiplication (*)
Additionally, multiplication must distribute over addition.
Ring implements some methods (for example fromInt) in terms of other more fundamental methods (zero, one and plus). Where possible, these methods should be overridden by more efficient implementations.
- Companion
- object
Value members
Concrete methods
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.
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 methods
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