Rng

algebra.ring.Rng
See theRng companion object
trait Rng[A] extends Semiring[A], AdditiveCommutativeGroup[A]

Rng (pronounced "Rung") consists of:

- a commutative group for addition (+) - a semigroup for multiplication (*)

Alternately, a Rng can be thought of as a ring without a multiplicative identity (or as a semiring with an additive inverse).

Mnemonic: "Rng is a Ring without multiplicative 'I'dentity."

Attributes

Companion
object
Source
Rng.scala
Graph
Supertypes
Known subtypes
trait CommutativeRng[A]
trait BoolRng[A]
class SetBoolRng[A]
class BoolRingFromBool[A]
trait BoolRing[A]
trait CommutativeRing[A]
class ByteAlgebra
class IntAlgebra
class LongAlgebra
class ShortAlgebra
class UnitAlgebra
trait GCDRing[A]
trait EuclideanRing[A]
trait Field[A]
class FloatAlgebra
trait Ring[A]
trait DivisionRing[A]
Show all

Members list

Value members

Inherited methods

def isZero(a: A)(implicit ev: Eq[A]): Boolean

Tests if a is zero.

Tests if a is zero.

Attributes

Inherited from:
AdditiveMonoid
Source
Additive.scala
def minus(x: A, y: A): A

Attributes

Inherited from:
AdditiveGroup
Source
Additive.scala

Attributes

Inherited from:
MultiplicativeSemigroup
Source
Multiplicative.scala
def negate(x: A): A

Attributes

Inherited from:
AdditiveGroup
Source
Additive.scala
def plus(x: A, y: A): A

Attributes

Inherited from:
AdditiveSemigroup
Source
Additive.scala
def pow(a: A, n: Int): A

Attributes

Inherited from:
MultiplicativeSemigroup
Source
Multiplicative.scala
def sum(as: IterableOnce[A]): A

Given a sequence of as, compute the sum.

Given a sequence of as, compute the sum.

Attributes

Inherited from:
AdditiveMonoid
Source
Additive.scala
override def sumN(a: A, n: Int): A

Attributes

Definition Classes
Inherited from:
AdditiveGroup
Source
Additive.scala
def times(x: A, y: A): A

Attributes

Inherited from:
MultiplicativeSemigroup
Source
Multiplicative.scala

Given a sequence of as, combine them and return the total.

Given a sequence of as, combine them and return the total.

If the sequence is empty, returns None. Otherwise, returns Some(total).

Attributes

Inherited from:
MultiplicativeSemigroup
Source
Multiplicative.scala
override def trySum(as: IterableOnce[A]): Option[A]

Given a sequence of as, combine them and return the total.

Given a sequence of as, combine them and return the total.

If the sequence is empty, returns None. Otherwise, returns Some(total).

Attributes

Definition Classes
Inherited from:
AdditiveMonoid
Source
Additive.scala
def zero: A

Attributes

Inherited from:
AdditiveMonoid
Source
Additive.scala