NaturalAlgebra

@SerialVersionUID(0L)
class NaturalAlgebra extends NaturalIsCRig with NaturalTruncatedDivision with Serializable
trait NaturalTruncatedDivision
trait NaturalSigned
trait NaturalOrder
trait Order[Natural]
trait PartialOrder[Natural]
trait Eq[Natural]
trait NaturalIsCRig
trait CommutativeRig[Natural]
trait MultiplicativeCommutativeMonoid[Natural]
trait CommutativeSemiring[Natural]
trait MultiplicativeCommutativeSemigroup[Natural]
trait Rig[Natural]
trait MultiplicativeMonoid[Natural]
trait Semiring[Natural]
trait MultiplicativeSemigroup[Natural]
trait AdditiveCommutativeMonoid[Natural]
trait AdditiveCommutativeSemigroup[Natural]
trait AdditiveMonoid[Natural]
trait AdditiveSemigroup[Natural]
trait Serializable
class Object
trait Matchable
class Any

Value members

Inherited methods

Inherited from
NaturalSigned
override
def additive: CommutativeMonoid[Natural]
Definition Classes
AdditiveCommutativeMonoid -> AdditiveCommutativeSemigroup -> AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveCommutativeMonoid
def compare(x: Natural, y: Natural): Int
Inherited from
NaturalOrder
def comparison(x: Natural, y: Natural): Comparison

Like compare, but returns a cats.kernel.Comparison instead of an Int. Has the benefit of being able to pattern match on, but not as performant.

Like compare, but returns a cats.kernel.Comparison instead of an Int. Has the benefit of being able to pattern match on, but not as performant.

Inherited from
Order
override
def eqv(x: Natural, y: Natural): Boolean
Definition Classes
NaturalOrder -> Order -> PartialOrder -> Eq
Inherited from
NaturalOrder
Inherited from
NaturalTruncatedDivision
Inherited from
NaturalTruncatedDivision
override
def gt(x: Natural, y: Natural): Boolean
Definition Classes
NaturalOrder -> Order -> PartialOrder
Inherited from
NaturalOrder
override
def gteqv(x: Natural, y: Natural): Boolean
Definition Classes
NaturalOrder -> Order -> PartialOrder
Inherited from
NaturalOrder
def isOne(a: Natural)(implicit ev: Eq[Natural]): Boolean

Tests if a is one.

Tests if a is one.

Inherited from
MultiplicativeMonoid
def isSignNegative(a: Natural): Boolean
Inherited from
Signed
def isSignNonNegative(a: Natural): Boolean
Inherited from
Signed
def isSignNonPositive(a: Natural): Boolean
Inherited from
Signed
def isSignNonZero(a: Natural): Boolean
Inherited from
Signed
def isSignPositive(a: Natural): Boolean
Inherited from
Signed
def isSignZero(a: Natural): Boolean
Inherited from
Signed
def isZero(a: Natural)(implicit ev: Eq[Natural]): Boolean

Tests if a is zero.

Tests if a is zero.

Inherited from
AdditiveMonoid
override
def lt(x: Natural, y: Natural): Boolean
Definition Classes
NaturalOrder -> Order -> PartialOrder
Inherited from
NaturalOrder
override
def lteqv(x: Natural, y: Natural): Boolean
Definition Classes
NaturalOrder -> Order -> PartialOrder
Inherited from
NaturalOrder
def max(x: Natural, y: Natural): Natural

If x > y, return x, else return y.

If x > y, return x, else return y.

Inherited from
Order
def min(x: Natural, y: Natural): Natural

If x < y, return x, else return y.

If x < y, return x, else return y.

Inherited from
Order
override
def multiplicative: CommutativeMonoid[Natural]
Definition Classes
MultiplicativeCommutativeMonoid -> MultiplicativeCommutativeSemigroup -> MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeCommutativeMonoid
override
def neqv(x: Natural, y: Natural): Boolean
Definition Classes
NaturalOrder -> Order -> Eq
Inherited from
NaturalOrder
Inherited from
NaturalIsCRig
def partialCompare(x: Natural, y: Natural): Double
Inherited from
Order
def partialComparison(x: Natural, y: Natural): Option[Comparison]

Like partialCompare, but returns a cats.kernel.Comparison instead of an Double. Has the benefit of being able to pattern match on, but not as performant.

Like partialCompare, but returns a cats.kernel.Comparison instead of an Double. Has the benefit of being able to pattern match on, but not as performant.

Inherited from
PartialOrder
Inherited from
NaturalIsCRig
def pmax(x: Natural, y: Natural): Option[Natural]

Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

Returns Some(x) if x >= y, Some(y) if x < y, otherwise None.

Inherited from
PartialOrder
def pmin(x: Natural, y: Natural): Option[Natural]

Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

Returns Some(x) if x <= y, Some(y) if x > y, otherwise None.

Inherited from
PartialOrder
override
def pow(a: Natural, b: Int): Natural
Definition Classes
NaturalIsCRig -> MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
NaturalIsCRig
def product(as: IterableOnce[Natural]): Natural

Given a sequence of as, compute the product.

Given a sequence of as, compute the product.

Inherited from
MultiplicativeMonoid
def sign(a: Natural): Sign

Returns Zero if a is 0, Positive if a is positive, and Negative is a is negative.

Returns Zero if a is 0, Positive if a is positive, and Negative is a is negative.

Inherited from
Signed
def signum(a: Natural): Int

Returns 0 if a is 0, 1 if a is positive, and -1 is a is negative.

Returns 0 if a is 0, 1 if a is positive, and -1 is a is negative.

Inherited from
SignedAdditiveCMonoid
def sum(as: IterableOnce[Natural]): Natural

Given a sequence of as, compute the sum.

Given a sequence of as, compute the sum.

Inherited from
AdditiveMonoid
override
def sumN(a: Natural, n: Int): Natural
Definition Classes
AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveMonoid
override
Definition Classes
NaturalIsCRig -> MultiplicativeSemigroup
Inherited from
NaturalIsCRig
Inherited from
NaturalTruncatedDivision
def toBigIntOpt(x: Natural): Opt[BigInt]
Inherited from
NaturalTruncatedDivision
def toOrdering: Ordering[Natural]

Convert a Order[A] to a scala.math.Ordering[A] instance.

Convert a Order[A] to a scala.math.Ordering[A] instance.

Inherited from
Order
Inherited from
NaturalTruncatedDivision
def tryCompare(x: Natural, y: Natural): Option[Int]

Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is:

Result of comparing x with y. Returns None if operands are not comparable. If operands are comparable, returns Some[Int] where the Int sign is:

  • negative iff x < y
  • zero iff x = y
  • positive iff x > y
Inherited from
PartialOrder
override
def tryProduct(as: IterableOnce[Natural]): Option[Natural]
Definition Classes
MultiplicativeMonoid -> MultiplicativeSemigroup
Inherited from
MultiplicativeMonoid
override
def trySum(as: IterableOnce[Natural]): Option[Natural]
Definition Classes
AdditiveMonoid -> AdditiveSemigroup
Inherited from
AdditiveMonoid
Inherited from
NaturalIsCRig