BigDecimalAlgebra

algebra.instances.BigDecimalAlgebra

Attributes

Source
bigDecimal.scala
Graph
Supertypes

Members list

Value members

Constructors

def this()

Attributes

Source
bigDecimal.scala

Concrete methods

Attributes

Source
bigDecimal.scala
override def fromBigInt(n: BigInt): BigDecimal

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
bigDecimal.scala
override def fromInt(n: Int): BigDecimal

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
bigDecimal.scala
override def minus(a: BigDecimal, b: BigDecimal): BigDecimal

Attributes

Definition Classes
Source
bigDecimal.scala

Attributes

Source
bigDecimal.scala

Attributes

Source
bigDecimal.scala
override def pow(a: BigDecimal, k: Int): BigDecimal

Attributes

Source
bigDecimal.scala

Inherited methods

def emod(a: BigDecimal, b: BigDecimal): A

Attributes

Inherited from:
Field
Source
Field.scala
def equot(a: BigDecimal, b: BigDecimal): A

Attributes

Inherited from:
Field
Source
Field.scala
override def equotmod(a: BigDecimal, b: BigDecimal): (A, A)

Attributes

Definition Classes
Inherited from:
Field
Source
Field.scala

Attributes

Inherited from:
Field
Source
Field.scala
override def fromDouble(a: Double): A

This is implemented in terms of basic Ring ops.

This is implemented in terms of basic Ring ops. However, this is probably significantly less efficient than can be done with a specific type. So, it is recommended that this method be overriden.

This is possible because a Double is a rational number.

Attributes

Definition Classes
Inherited from:
Field
Source
Field.scala
override def gcd(a: BigDecimal, b: BigDecimal)(implicit eqA: Eq[BigDecimal]): A

Attributes

Definition Classes
Inherited from:
Field
Source
Field.scala
def isOne(a: BigDecimal)(implicit ev: Eq[BigDecimal]): Boolean

Tests if a is one.

Tests if a is one.

Attributes

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

Tests if a is zero.

Tests if a is zero.

Attributes

Inherited from:
AdditiveMonoid
Source
Additive.scala
override def lcm(a: BigDecimal, b: BigDecimal)(implicit eqA: Eq[BigDecimal]): A

Attributes

Definition Classes
Inherited from:
Field
Source
Field.scala

Given a sequence of as, compute the product.

Given a sequence of as, compute the product.

Attributes

Inherited from:
MultiplicativeMonoid
Source
Multiplicative.scala
def reciprocal(x: BigDecimal): A

Attributes

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

Attributes

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

Concrete fields

Attributes

Source
bigDecimal.scala

Attributes

Source
bigDecimal.scala