given_ArchimedeanField_BigDecimal

com.alecdorrington.scalgebra.evidence.numeric.BigDecimalIsArchimedeanField.given_ArchimedeanField_BigDecimal

Attributes

Graph
Supertypes
trait ArchimedeanField[BigDecimal]
trait OrderedField[BigDecimal]
trait Field[BigDecimal]
trait ArchimedeanDifferenceSemifield[BigDecimal]
trait OrderedDifferenceSemifield[BigDecimal]
trait DifferenceSemifield[BigDecimal]
trait ArchimedeanSemifield[BigDecimal]
trait OrderedSemifield[BigDecimal]
trait Semifield[BigDecimal]
trait ArchimedeanMultiplicativeGroup[BigDecimal]
trait OrderedMultiplicativeGroup[BigDecimal]
trait MultiplicativeGroup[BigDecimal]
trait OrderedMultiplicativeInverse[BigDecimal]
trait MultiplicativeInverse[BigDecimal]
trait ArchimedeanQuotientRing[BigDecimal]
trait OrderedQuotientRing[BigDecimal]
trait QuotientRing[BigDecimal]
trait QuotientDifferenceSemiring[BigDecimal]
trait ArchimedeanQuotientSemiring[BigDecimal]
trait OrderedQuotientSemiring[BigDecimal]
trait QuotientSemiring[BigDecimal]
trait ArchimedeanQuotientMonoid[BigDecimal]
trait OrderedQuotientMonoid[BigDecimal]
trait QuotientMonoid[BigDecimal]
trait ArchimedeanQuotientSemigroup[BigDecimal]
trait OrderedQuotientSemigroup[BigDecimal]
trait QuotientSemigroup[BigDecimal]
trait ArchimedeanQuotient[BigDecimal]
trait OrderedQuotient[BigDecimal]
trait Quotient[BigDecimal]
trait ArchimedeanRing[BigDecimal]
trait OrderedRing[BigDecimal]
trait Ring[BigDecimal]
trait ArchimedeanDifferenceSemiring[BigDecimal]
trait OrderedDifferenceSemiring[BigDecimal]
trait DifferenceSemiring[BigDecimal]
trait ArchimedeanSemiring[BigDecimal]
trait OrderedSemiring[BigDecimal]
trait Semiring[BigDecimal]
trait OrderedMultiplicativeMonoid[BigDecimal]
trait MultiplicativeMonoid[BigDecimal]
trait OrderedMultiplicativeIdentity[BigDecimal]
trait MultiplicativeIdentity[BigDecimal]
trait ArchimedeanPseudoring[BigDecimal]
trait OrderedPseudoring[BigDecimal]
trait Pseudoring[BigDecimal]
trait OrderedMultiplicativeSemigroup[BigDecimal]
trait MultiplicativeSemigroup[BigDecimal]
trait ArchimedeanMultiplicativeMagma[BigDecimal]
trait OrderedMultiplicativeMagma[BigDecimal]
trait MultiplicativeMagma[BigDecimal]
trait ArchimedeanAdditiveGroup[BigDecimal]
trait OrderedAdditiveGroup[BigDecimal]
trait AdditiveGroup[BigDecimal]
trait ArchimedeanAdditiveInverse[BigDecimal]
trait OrderedAdditiveInverse[BigDecimal]
trait AdditiveInverse[BigDecimal]
trait ArchimedeanDifferenceMonoid[BigDecimal]
trait OrderedDifferenceMonoid[BigDecimal]
trait DifferenceMonoid[BigDecimal]
trait ArchimedeanAdditiveMonoid[BigDecimal]
trait OrderedAdditiveMonoid[BigDecimal]
trait AdditiveMonoid[BigDecimal]
trait ArchimedeanAdditiveIdentity[BigDecimal]
trait OrderedAdditiveIdentity[BigDecimal]
trait AdditiveIdentity[BigDecimal]
trait ArchimedeanDifferenceSemigroup[BigDecimal]
trait OrderedDifferenceSemigroup[BigDecimal]
trait DifferenceSemigroup[BigDecimal]
trait ArchimedeanAdditiveSemigroup[BigDecimal]
trait OrderedAdditiveSemigroup[BigDecimal]
trait AdditiveSemigroup[BigDecimal]
trait ArchimedeanAdditiveMagma[BigDecimal]
trait OrderedAdditiveMagma[BigDecimal]
trait AdditiveMagma[BigDecimal]
trait ArchimedeanDifference[BigDecimal]
trait OrderedDifference[BigDecimal]
trait Difference[BigDecimal]
trait Archimedean[BigDecimal]
trait Ordered[BigDecimal]
trait Algebra[BigDecimal]
trait Ordering[BigDecimal]
trait PartialOrdering[BigDecimal]
trait Equiv[BigDecimal]
trait Serializable
trait Comparator[BigDecimal]
class Object
trait Matchable
class Any
Show all
Self type

Members list

Type members

Inherited classlikes

class OrderingOps(lhs: Ordering.this.T)

This inner class defines comparison operators available for T.

This inner class defines comparison operators available for T.

It can't extend AnyVal because it is not a top-level class or a member of a statically accessible object.

Attributes

Inherited from:
Ordering
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

override def compare(x: BigDecimal, y: BigDecimal): Int

Returns an integer whose sign communicates how x compares to y.

Returns an integer whose sign communicates how x compares to y.

The result sign has the following meaning:

  • negative if x < y
  • positive if x > y
  • zero otherwise (if x == y)

Attributes

Definition Classes
Ordering -> Comparator
override def one: BigDecimal

The unique multiplicative identity in this algebra. Typically given by values such as 1 or 1.0F.

The unique multiplicative identity in this algebra. Typically given by values such as 1 or 1.0F.

Attributes

Definition Classes
override def zero: BigDecimal

The unique additive identity in this algebra. Typically given by values such as 0, 0.0F, or Seq.empty.

The unique additive identity in this algebra. Typically given by values such as 0, 0.0F, or Seq.empty.

Attributes

Definition Classes

Inherited methods

override def equiv(x: BigDecimal, y: BigDecimal): Boolean

Returns true if x == y in the ordering.

Returns true if x == y in the ordering.

Attributes

Definition Classes
Ordering -> PartialOrdering -> Equiv
Inherited from:
Ordering
def fromInt(n: Int): BigDecimal

Computes the canonical representation of the integer n in this algebra, i.e. 1 + 1 + … + 1 (n times).

Computes the canonical representation of the integer n in this algebra, i.e. 1 + 1 + … + 1 (n times).

Attributes

Throws
IllegalArgumentException

if n &lt; 0 and this algebra has no additive inverse.

Inherited from:
Semiring
override def gt(x: BigDecimal, y: BigDecimal): Boolean

Returns true if x > y in the ordering.

Returns true if x > y in the ordering.

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def gteq(x: BigDecimal, y: BigDecimal): Boolean

Returns true if x >= y in the ordering.

Returns true if x >= y in the ordering.

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def isReverseOf(other: Ordering[_]): Boolean

Returns whether or not the other ordering is the opposite ordering of this one.

Returns whether or not the other ordering is the opposite ordering of this one.

Equivalent to other == this.reverse.

Implementations should only override this method if they are overriding reverse as well.

Attributes

Inherited from:
Ordering
override def lt(x: BigDecimal, y: BigDecimal): Boolean

Returns true if x < y in the ordering.

Returns true if x < y in the ordering.

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
override def lteq(x: BigDecimal, y: BigDecimal): Boolean

Returns true if x <= y in the ordering.

Returns true if x <= y in the ordering.

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def max[U <: BigDecimal](x: U, y: U): U

Returns x if x >= y, otherwise y.

Returns x if x >= y, otherwise y.

Attributes

Inherited from:
Ordering
def min[U <: BigDecimal](x: U, y: U): U

Returns x if x <= y, otherwise y.

Returns x if x <= y, otherwise y.

Attributes

Inherited from:
Ordering
def on[U](f: U => BigDecimal): Ordering[U]

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

Given f, a function from U into T, creates an Ordering[U] whose compare function is equivalent to:

def compare(x:U, y:U) = Ordering[T].compare(f(x), f(y))

Attributes

Inherited from:
Ordering
def orElse(other: Ordering[BigDecimal]): Ordering[BigDecimal]

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else the result of others compare function.

Value parameters

other

an Ordering to use if this Ordering returns zero

Attributes

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElse(Ordering.by[Pair, Int](_.b))
Inherited from:
Ordering
def orElseBy[S](f: BigDecimal => S)(implicit ord: Ordering[S]): Ordering[BigDecimal]

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

Given f, a function from T into S, creates an Ordering[T] whose compare function returns the result of this Ordering's compare function, if it is non-zero, or else a result equivalent to:

Ordering[S].compare(f(x), f(y))

This function is equivalent to passing the result of Ordering.by(f) to orElse.

Attributes

Example
case class Pair(a: Int, b: Int)
val pairOrdering = Ordering.by[Pair, Int](_.a)
                          .orElseBy[Int](_.b)
Inherited from:
Ordering
override def reverse: Ordering[BigDecimal]

Returns the opposite ordering of this one.

Returns the opposite ordering of this one.

Implementations overriding this method MUST override isReverseOf as well if they change the behavior at all (for example, caching does not require overriding it).

Attributes

Definition Classes
Ordering -> PartialOrdering
Inherited from:
Ordering
def reversed(): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def thenComparing[U <: Comparable[_ >: U <: <FromJavaObject>]](x$0: Function[_ >: BigDecimal <: <FromJavaObject>, _ <: U]): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def thenComparing[U <: <FromJavaObject>](x$0: Function[_ >: BigDecimal <: <FromJavaObject>, _ <: U], x$1: Comparator[_ >: U <: <FromJavaObject>]): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def thenComparing(x$0: Comparator[_ >: BigDecimal <: <FromJavaObject>]): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def thenComparingDouble(x$0: ToDoubleFunction[_ >: BigDecimal <: <FromJavaObject>]): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def thenComparingInt(x$0: ToIntFunction[_ >: BigDecimal <: <FromJavaObject>]): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def thenComparingLong(x$0: ToLongFunction[_ >: BigDecimal <: <FromJavaObject>]): Comparator[BigDecimal]

Attributes

Inherited from:
Comparator
def tryCompare(x: BigDecimal, y: BigDecimal): Some[Int]

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Returns whether a comparison between x and y is defined, and if so the result of compare(x, y).

Attributes

Inherited from:
Ordering

Extensions

Extensions

extension (x: BigDecimal)
override def add(y: BigDecimal): BigDecimal

Computes the sum of two values x and y, i.e. x + y.

Computes the sum of two values x and y, i.e. x + y.

Attributes

Definition Classes
override def floor: BigDecimal

Rounds a value x downwards (towards negative infinity) to the nearest integer value.

Rounds a value x downwards (towards negative infinity) to the nearest integer value.

Attributes

See also

ceil.

Definition Classes
override def mul(y: BigDecimal): BigDecimal

Computes the product of two values x and y, i.e. x × y.

Computes the product of two values x and y, i.e. x × y.

Attributes

Definition Classes
override def negate: BigDecimal

Computes the additive inverse (negative) of a value x, i.e. -x.

Computes the additive inverse (negative) of a value x, i.e. -x.

Attributes

Definition Classes
override def reciprocal: BigDecimal

Computes the multiplicative inverse (reciprocal) of a value x, i.e. 1 / x.

Computes the multiplicative inverse (reciprocal) of a value x, i.e. 1 / x.

Attributes

Throws
ArithmeticException

if x == zero.

Definition Classes

Inherited extensions

extension (x: BigDecimal)
infix inline def /(y: BigDecimal): BigDecimal

An alias for div.

An alias for div.

Attributes

Inherited from:
Quotient
extension (x: BigDecimal)
infix inline def -(y: BigDecimal): BigDecimal

An alias for subtract.

An alias for subtract.

Attributes

Inherited from:
Difference
extension (x: BigDecimal)
infix inline def +(y: BigDecimal): BigDecimal

An alias for add.

An alias for add.

Attributes

Inherited from:
AdditiveMagma
extension (x: BigDecimal)
infix inline def <(y: BigDecimal): Boolean

Attributes

Returns

true if and only if the left operand x is strictly smaller than the right y.

Inherited from:
Ordered
infix inline def <=(y: BigDecimal): Boolean

Attributes

Returns

true if and only if the left operand x is not larger than the right y.

Inherited from:
Ordered
infix inline def >(y: BigDecimal): Boolean

Attributes

Returns

true if and only if the left operand x is strictly larger than the right y.

Inherited from:
Ordered
infix inline def >=(y: BigDecimal): Boolean

Attributes

Returns

true if and only if the left operand x is not smaller than the right y.

Inherited from:
Ordered
def clamp(lb: BigDecimal, ub: BigDecimal): BigDecimal

Clamps x to lie within the inclusive range [lb, ub].

Clamps x to lie within the inclusive range [lb, ub].

Attributes

Returns

lb if x &lt; lb, ub if x > ub, or x otherwise. If the range is degenerate, i.e. lb > ub, then x is returned unchanged.

Inherited from:
Ordered
infix def max(y: BigDecimal): BigDecimal

Attributes

Returns

The greater of both operands.

Inherited from:
Ordered
infix def min(y: BigDecimal): BigDecimal

Attributes

Returns

The lesser of both operands.

Inherited from:
Ordered
extension (x: BigDecimal)
infix inline def *(y: BigDecimal): BigDecimal

An alias for mul.

An alias for mul.

Attributes

Inherited from:
MultiplicativeMagma
extension (x: BigDecimal)
inline def unary_-: BigDecimal

An alias for negate.

An alias for negate.

Attributes

Inherited from:
AdditiveInverse
extension (x: BigDecimal)
inline def isNegative: Boolean

Attributes

Returns

true if and only if x is strictly negative, i.e. x &lt; 0.

Inherited from:
OrderedAdditiveIdentity
inline def isNonNegative: Boolean

Attributes

Returns

true if and only if x is positive or zero, i.e. x ≥ 0.

Inherited from:
OrderedAdditiveIdentity
inline def isNonPositive: Boolean

Attributes

Returns

true if and only if x is negative or zero, i.e. x ≤ 0.

Inherited from:
OrderedAdditiveIdentity
inline def isPositive: Boolean

Attributes

Returns

true if and only if x is strictly positive, i.e. x > 0.

Inherited from:
OrderedAdditiveIdentity
extension (x: BigDecimal)
def frac: BigDecimal

Computes the fractional part of x, i.e. x - ⌊x⌋.

Computes the fractional part of x, i.e. x - ⌊x⌋.

Attributes

Note

The result will always fall in the half-open interval [0, 1).

Inherited from:
ArchimedeanDifference
extension (x: BigDecimal)
inline def divOption(y: BigDecimal): Option[BigDecimal]

A version of div which returns None when y == zero.

A version of div which returns None when y == zero.

Attributes

Inherited from:
QuotientSemiring
extension (x: BigDecimal)
infix inline def *:(n: Int): BigDecimal

An alias for scale, with the factor on the left.

An alias for scale, with the factor on the left.

Attributes

Inherited from:
AdditiveSemigroup
infix inline def :*(n: Int): BigDecimal

An alias for scale, with the factor on the right.

An alias for scale, with the factor on the right.

Attributes

Inherited from:
AdditiveSemigroup
extension (x: BigDecimal)
inline def isZero: Boolean

Attributes

Returns

true if and only if x equals zero.

Inherited from:
AdditiveIdentity
inline def nonZero: Boolean

Attributes

Returns

true if and only if x doesn't equal zero.

Inherited from:
AdditiveIdentity
extension (x: BigDecimal)
inline def isOne: Boolean

Attributes

Returns

true if and only if x equals one.

Inherited from:
MultiplicativeIdentity
inline def nonOne: Boolean

Attributes

Returns

true if and only if x doesn't equal one.

Inherited from:
MultiplicativeIdentity
extension (x: BigDecimal)
infix inline def **(n: Int): BigDecimal

An alias for pow.

An alias for pow.

Attributes

Inherited from:
MultiplicativeSemigroup
extension (x: BigDecimal)
def truncate: BigDecimal

Rounds a value x towards zero (downwards if x is positive or upwards if x is negative).

Rounds a value x towards zero (downwards if x is positive or upwards if x is negative).

Attributes

Inherited from:
ArchimedeanAdditiveIdentity
extension (x: BigDecimal)
override def ceil: BigDecimal

Rounds a value x upwards (towards positive infinity) to the nearest integer value.

Rounds a value x upwards (towards positive infinity) to the nearest integer value.

Attributes

See also
Definition Classes
Inherited from:
ArchimedeanAdditiveInverse
extension (x: BigDecimal)
inline def reciprocalOption: Option[BigDecimal]

A version of reciprocal which returns None when x == zero.

A version of reciprocal which returns None when x == zero.

Attributes

Inherited from:
Semifield
extension (x: BigDecimal)
override def scale(n: Int): BigDecimal

Computes x multiplied by n, for any integer n.

Computes x multiplied by n, for any integer n.

Attributes

Definition Classes
Inherited from:
AdditiveGroup
override def subtract(y: BigDecimal): BigDecimal

Computes the difference between two values x and y, i.e. x - y.

Computes the difference between two values x and y, i.e. x - y.

Attributes

Definition Classes
Inherited from:
AdditiveGroup
extension (x: BigDecimal)
override def gcd(y: BigDecimal): BigDecimal

Computes the greatest common divisor of x and y.

Computes the greatest common divisor of x and y.

Attributes

Note

In a field, every non-zero value divides every other, so the result is canonically one, unless both operands are zero.

Definition Classes
Inherited from:
Field
override def lcm(y: BigDecimal): BigDecimal

Computes the lowest common multiple of x and y.

Computes the lowest common multiple of x and y.

Attributes

Note

In a field, every non-zero value is a multiple of every other, so the result is canonically one, unless either operand is zero.

Definition Classes
Inherited from:
Field
override def mod(y: BigDecimal): BigDecimal

Computes the remainder upon dividing x by y.

Computes the remainder upon dividing x by y.

Attributes

Note

In a field, division is exact, so the remainder is always zero.

Definition Classes
Inherited from:
Field
extension (x: BigDecimal)
infix inline def %(y: BigDecimal): BigDecimal

An alias for mod.

An alias for mod.

Attributes

Inherited from:
QuotientDifferenceSemiring
inline def modOption(y: BigDecimal): Option[BigDecimal]

A version of mod which returns None when y == zero.

A version of mod which returns None when y == zero.

Attributes

Inherited from:
QuotientDifferenceSemiring
extension (x: BigDecimal)
def abs: BigDecimal

Computes the absolute value of a value x, i.e. |x| = x if x ≥ 0 or else -x if x &lt; 0.

Computes the absolute value of a value x, i.e. |x| = x if x ≥ 0 or else -x if x &lt; 0.

Attributes

Inherited from:
OrderedAdditiveGroup
extension (x: BigDecimal)
def sign: BigDecimal

Determines the sign of a value x, given by one if x is positive, the negation of one if x is negative, or zero if x is itself zero.

Determines the sign of a value x, given by one if x is positive, the negation of one if x is negative, or zero if x is itself zero.

Attributes

Inherited from:
OrderedRing
extension (x: BigDecimal)
override def div(y: BigDecimal): BigDecimal

Computes the quotient between a dividend x and a divisor y, i.e. x / y.

Computes the quotient between a dividend x and a divisor y, i.e. x / y.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

For imprecise (e.g. integer) arithmetic, the result is rounded towards zero.

Definition Classes
Inherited from:
MultiplicativeGroup
override def pow(n: Int): BigDecimal

Computes x raised to the power of n, for any integer n.

Computes x raised to the power of n, for any integer n.

Attributes

Throws
ArithmeticException

if n &lt; 0 and x == zero.

Definition Classes
Inherited from:
MultiplicativeGroup
extension (x: BigDecimal)
def euclideanDiv(y: BigDecimal): BigDecimal

Computes the Euclidean quotient between a dividend x and a divisor y.

Computes the Euclidean quotient between a dividend x and a divisor y.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

For imprecise (e.g. integer) arithmetic, the result is rounded towards negative infinity if y > 0, or otherwise towards positive infinity if y &lt; 0.

Inherited from:
OrderedQuotientRing
def euclideanMod(y: BigDecimal): BigDecimal

Computes the Euclidean remainder between a dividend x and a divisor y.

Computes the Euclidean remainder between a dividend x and a divisor y.

The signs of x and y are both ignored.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

The result will always be non-negative, and fall in the half-open interval [0, |y|).

Inherited from:
OrderedQuotientRing
def floorDiv(y: BigDecimal): BigDecimal

Computes the floored quotient between a dividend x and a divisor y.

Computes the floored quotient between a dividend x and a divisor y.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

For imprecise (e.g. integer) arithmetic, the result is rounded towards negative infinity.

Inherited from:
OrderedQuotientRing
def floorMod(y: BigDecimal): BigDecimal

Computes the floored remainder between a dividend x and a divisor y.

Computes the floored remainder between a dividend x and a divisor y.

The sign of y determines the sign of the result. The sign of x is ignored.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

The result will always fall in the half-open interval [0, y) if y > 0, or otherwise in (y, 0] if y &lt; 0.

Inherited from:
OrderedQuotientRing
extension (x: BigDecimal)
def round: BigDecimal

Rounds a value x to the nearest integer value (with ties rounded up).

Rounds a value x to the nearest integer value (with ties rounded up).

Attributes

Inherited from:
ArchimedeanDifferenceSemiring
extension (x: BigDecimal)
def euclideanRemainder(y: BigDecimal): BigDecimal

Computes the Euclidean remainder between a dividend x and a divisor y, relative to the nearest integer quotient rounded away from the remainder.

Computes the Euclidean remainder between a dividend x and a divisor y, relative to the nearest integer quotient rounded away from the remainder.

Unlike euclideanMod, which inherits its rounding behaviour from div (and is therefore always zero when division is exact), the quotient here is always rounded to an integer value first. The two coincide when div itself produces integer values.

The signs of x and y are both ignored.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

The result will always be non-negative, and fall in the half-open interval [0, |y|).

Inherited from:
ArchimedeanQuotientRing
def floorRemainder(y: BigDecimal): BigDecimal

Computes the floored remainder between a dividend x and a divisor y, relative to the nearest integer quotient rounded towards negative infinity.

Computes the floored remainder between a dividend x and a divisor y, relative to the nearest integer quotient rounded towards negative infinity.

Unlike floorMod, which inherits its rounding behaviour from div (and is therefore always zero when division is exact), the quotient here is always rounded to an integer value first. The two coincide when div itself produces integer values.

The sign of y determines the sign of the result. The sign of x is ignored.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

The result will always fall in the half-open interval [0, y) if y > 0, or otherwise in (y, 0] if y &lt; 0.

Inherited from:
ArchimedeanQuotientRing
def remainder(y: BigDecimal): BigDecimal

Computes the signed remainder between a dividend x and a divisor y, relative to the nearest integer quotient rounded towards zero.

Computes the signed remainder between a dividend x and a divisor y, relative to the nearest integer quotient rounded towards zero.

Unlike mod, which inherits its rounding behaviour from div (and is therefore always zero when division is exact), the quotient here is always rounded to an integer value first. The two coincide when div itself produces integer values.

The sign of x only determines the sign of the result. The sign of y is ignored.

Attributes

Throws
ArithmeticException

if y == zero.

See also
Note

The result will always fall in the half-open interval [0, |y|) if x ≥ 0, or otherwise in (-|y|, 0] if x &lt; 0.

Inherited from:
ArchimedeanQuotientRing
extension (x: BigDecimal)
inline def isFractional: Boolean

Attributes

Returns

true if and only if x is not an integer value.

Inherited from:
Archimedean
inline def isIntegral: Boolean

Attributes

Returns

true if and only if x is an integer value.

Inherited from:
Archimedean
extension (xs: Iterable[BigDecimal])
inline def sumOrZero: BigDecimal

Computes the sum of all values in xs, i.e. xs₁ + xs₂ + …, or else zero if xs is empty.

Computes the sum of all values in xs, i.e. xs₁ + xs₂ + …, or else zero if xs is empty.

Attributes

Inherited from:
AdditiveMonoid
extension (xs: Iterable[BigDecimal])
inline def productOrOne: BigDecimal

Computes the product of all values in xs, i.e. xs₁ × xs₂ × …, or else one if xs is empty.

Computes the product of all values in xs, i.e. xs₁ × xs₂ × …, or else one if xs is empty.

Attributes

Inherited from:
MultiplicativeMonoid
extension (xs: Iterable[BigDecimal])
inline def productFrom(x: BigDecimal): BigDecimal

Computes the product of x and all values in xs, i.e. x × xs₁ × xs₂ × ….

Computes the product of x and all values in xs, i.e. x × xs₁ × xs₂ × ….

Attributes

Inherited from:
MultiplicativeSemigroup
inline def productOption: Option[BigDecimal]

Computes the product of all values in xs, i.e. xs₁ × xs₂ × …, or else None if xs is empty.

Computes the product of all values in xs, i.e. xs₁ × xs₂ × …, or else None if xs is empty.

Attributes

Inherited from:
MultiplicativeSemigroup
inline def productOrElse[Y >: BigDecimal](default: Y): Y

Computes the product of all values in xs, i.e. xs₁ × xs₂ × …, or else default if xs is empty.

Computes the product of all values in xs, i.e. xs₁ × xs₂ × …, or else default if xs is empty.

Attributes

Inherited from:
MultiplicativeSemigroup
extension (xs: Iterable[BigDecimal])
inline def sumFrom(x: BigDecimal): BigDecimal

Computes the sum of x and all values in xs, i.e. x + xs₁ + xs₂ + ….

Computes the sum of x and all values in xs, i.e. x + xs₁ + xs₂ + ….

Attributes

Inherited from:
AdditiveSemigroup
inline def sumOption: Option[BigDecimal]

Computes the sum of all values in xs, i.e. xs₁ + xs₂ + …, or else None if xs is empty.

Computes the sum of all values in xs, i.e. xs₁ + xs₂ + …, or else None if xs is empty.

Attributes

Inherited from:
AdditiveSemigroup
inline def sumOrElse[Y >: BigDecimal](default: Y): Y

Computes the sum of all values in xs, i.e. xs₁ + xs₂ + …, or else default if xs is empty.

Computes the sum of all values in xs, i.e. xs₁ + xs₂ + …, or else default if xs is empty.

Attributes

Inherited from:
AdditiveSemigroup

Implicits

Inherited implicits

implicit def mkOrderingOps(lhs: BigDecimal): OrderingOps

This implicit method augments T with the comparison operators defined in scala.math.Ordering.Ops.

This implicit method augments T with the comparison operators defined in scala.math.Ordering.Ops.

Attributes

Inherited from:
Ordering