DoubleAlgebra

algebra.instances.DoubleAlgebra

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

If you would prefer an absolutely lawful fractional value, you'll need to investigate rational numbers or more exotic types.

Attributes

Source:
double.scala
Graph
Supertypes

Members list

Concise view

Value members

Concrete methods

def div(x: Double, y: Double): Double

Attributes

Source:
double.scala
override def fromBigInt(n: BigInt): Double

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:
double.scala
override def fromDouble(x: Double): Double

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 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
Source:
double.scala
override def fromInt(x: Int): Double

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:
double.scala
override def minus(x: Double, y: Double): Double

Attributes

Definition Classes
Source:
double.scala

Attributes

Source:
double.scala
def one: Double

Attributes

Source:
double.scala
def plus(x: Double, y: Double): Double

Attributes

Source:
double.scala
override def pow(x: Double, y: Int): Double
override def reciprocal(x: Double): Double

Attributes

Definition Classes
Source:
double.scala
def times(x: Double, y: Double): Double

Attributes

Source:
double.scala

Attributes

Source:
double.scala

Inherited methods

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

Attributes

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

Attributes

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

Attributes

Definition Classes
Inherited from:
Field
Source:
Field.scala

Attributes

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

Attributes

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

Tests if a is one.

Tests if a is one.

Attributes

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

Tests if a is zero.

Tests if a is zero.

Attributes

Inherited from:
AdditiveMonoid
Source:
Additive.scala
override def lcm(a: Double, b: Double)(implicit eqA: Eq[Double]): 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 sum(as: IterableOnce[Double]): 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: Double, n: Int): A

Attributes

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