class BigDecimalAlgebra extends Field[BigDecimal] with Serializable
- Source
- bigDecimal.scala
- Alphabetic
- By Inheritance
- BigDecimalAlgebra
- Field
- MultiplicativeCommutativeGroup
- MultiplicativeGroup
- CommutativeRing
- CommutativeRng
- CommutativeRig
- MultiplicativeCommutativeMonoid
- CommutativeSemiring
- MultiplicativeCommutativeSemigroup
- Ring
- Rng
- AdditiveCommutativeGroup
- AdditiveGroup
- Rig
- MultiplicativeMonoid
- Semiring
- MultiplicativeSemigroup
- AdditiveCommutativeMonoid
- AdditiveCommutativeSemigroup
- AdditiveMonoid
- AdditiveSemigroup
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
additive: CommutativeGroup[BigDecimal]
- Definition Classes
- AdditiveCommutativeGroup → AdditiveCommutativeMonoid → AdditiveCommutativeSemigroup → AdditiveGroup → AdditiveMonoid → AdditiveSemigroup
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
div(a: BigDecimal, b: BigDecimal): BigDecimal
- Definition Classes
- BigDecimalAlgebra → MultiplicativeGroup
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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'sone
, or-n
summations of-one
ifn
is negative.Most type class instances should consider overriding this method for performance reasons.
- Definition Classes
- BigDecimalAlgebra → Ring
-
def
fromDouble(a: Double): BigDecimal
This is implemented in terms of basic Field ops.
This is implemented in terms of basic Field 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.
- Definition Classes
- Field
-
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'sone
, or-n
summations of-one
ifn
is negative.Most type class instances should consider overriding this method for performance reasons.
- Definition Classes
- BigDecimalAlgebra → Ring
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isOne(a: BigDecimal)(implicit ev: Eq[BigDecimal]): Boolean
Tests if
a
is one.Tests if
a
is one.- Definition Classes
- MultiplicativeMonoid
-
def
isZero(a: BigDecimal)(implicit ev: Eq[BigDecimal]): Boolean
Tests if
a
is zero.Tests if
a
is zero.- Definition Classes
- AdditiveMonoid
-
def
minus(a: BigDecimal, b: BigDecimal): BigDecimal
- Definition Classes
- BigDecimalAlgebra → AdditiveGroup
- def multiplicative: CommutativeGroup[BigDecimal]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
negate(a: BigDecimal): BigDecimal
- Definition Classes
- BigDecimalAlgebra → AdditiveGroup
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
val
one: BigDecimal
- Definition Classes
- BigDecimalAlgebra → MultiplicativeMonoid
-
def
plus(a: BigDecimal, b: BigDecimal): BigDecimal
- Definition Classes
- BigDecimalAlgebra → AdditiveSemigroup
-
def
positivePow(a: BigDecimal, n: Int): BigDecimal
- Attributes
- protected[this]
- Definition Classes
- MultiplicativeSemigroup
-
def
positiveSumN(a: BigDecimal, n: Int): BigDecimal
- Attributes
- protected[this]
- Definition Classes
- AdditiveSemigroup
-
def
pow(a: BigDecimal, k: Int): BigDecimal
- Definition Classes
- BigDecimalAlgebra → MultiplicativeGroup → MultiplicativeMonoid → MultiplicativeSemigroup
-
def
product(as: TraversableOnce[BigDecimal]): BigDecimal
Given a sequence of
as
, compute the product.Given a sequence of
as
, compute the product.- Definition Classes
- MultiplicativeMonoid
-
def
reciprocal(x: BigDecimal): BigDecimal
- Definition Classes
- MultiplicativeGroup
-
def
sum(as: TraversableOnce[BigDecimal]): BigDecimal
Given a sequence of
as
, compute the sum.Given a sequence of
as
, compute the sum.- Definition Classes
- AdditiveMonoid
-
def
sumN(a: BigDecimal, n: Int): BigDecimal
- Definition Classes
- AdditiveGroup → AdditiveMonoid → AdditiveSemigroup
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
times(a: BigDecimal, b: BigDecimal): BigDecimal
- Definition Classes
- BigDecimalAlgebra → MultiplicativeSemigroup
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
tryProduct(as: TraversableOnce[BigDecimal]): Option[BigDecimal]
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).
- Definition Classes
- MultiplicativeMonoid → MultiplicativeSemigroup
-
def
trySum(as: TraversableOnce[BigDecimal]): Option[BigDecimal]
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).
- Definition Classes
- AdditiveMonoid → AdditiveSemigroup
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
val
zero: BigDecimal
- Definition Classes
- BigDecimalAlgebra → AdditiveMonoid