IntAlgebra

algebra.instances.IntAlgebra

Attributes

Source:
int.scala
Graph
Supertypes

Members list

Concise view

Value members

Concrete methods

override def fromBigInt(n: BigInt): Int

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.

Attributes

Definition Classes
Source:
int.scala
override def fromInt(n: Int): Int

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.

Attributes

Definition Classes
Source:
int.scala
override def minus(x: Int, y: Int): Int

Attributes

Definition Classes
Source:
int.scala
def negate(x: Int): Int

Attributes

Source:
int.scala
def one: Int

Attributes

Source:
int.scala
def plus(x: Int, y: Int): Int

Attributes

Source:
int.scala
override def pow(x: Int, y: Int): Int

Attributes

Definition Classes
Source:
int.scala
def times(x: Int, y: Int): Int

Attributes

Source:
int.scala
def zero: Int

Attributes

Source:
int.scala

Inherited methods

def isOne(a: Int)(implicit ev: Eq[Int]): Boolean

Tests if a is one.

Tests if a is one.

Attributes

Inherited from:
MultiplicativeMonoid
Source:
Multiplicative.scala
def isZero(a: Int)(implicit ev: Eq[Int]): Boolean

Tests if a is zero.

Tests if a is zero.

Attributes

Inherited from:
AdditiveMonoid
Source:
Additive.scala
def product(as: IterableOnce[Int]): A

Given a sequence of as, compute the product.

Given a sequence of as, compute the product.

Attributes

Inherited from:
MultiplicativeMonoid
Source:
Multiplicative.scala
def sum(as: IterableOnce[Int]): 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: Int, n: Int): A

Attributes

Definition Classes
Inherited from:
AdditiveGroup
Source:
Additive.scala
override def tryProduct(as: IterableOnce[Int]): 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:
MultiplicativeMonoid
Source:
Multiplicative.scala
override def trySum(as: IterableOnce[Int]): 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