scala

class BigDecimal

[source: scala/BigDecimal.scala]

@serializable

class BigDecimal(val bigDecimal : java.math.BigDecimal, val mc : java.math.MathContext)
extends java.lang.Number with AnyRef
Author
Stephane Micheloud
Version
1.0
Additional Constructor Summary
def this (bigDecimal : java.math.BigDecimal) : BigDecimal
Method Summary
def * (that : BigDecimal) : BigDecimal
Multiplication of BigDecimals
def + (that : BigDecimal) : BigDecimal
Addition of BigDecimals
def - (that : BigDecimal) : BigDecimal
Subtraction of BigDecimals
def / (that : BigDecimal) : BigDecimal
Division of BigDecimals
def /% (that : BigDecimal) : (BigDecimal, BigDecimal)
Division and Remainder - returns tuple containing the result of divideToIntegralValue and the remainder.
def < (that : BigDecimal) : Boolean
Less-than of BigDecimals
def <= (that : BigDecimal) : Boolean
Less-than-or-equals comparison of BigDecimals
def > (that : BigDecimal) : Boolean
Greater-than comparison of BigDecimals
def >= (that : BigDecimal) : Boolean
Greater-than-or-equals comparison of BigDecimals
def abs : BigDecimal
Returns the absolute value of this BigDecimal
def apply (mc : java.math.MathContext) : BigDecimal
Returns a new BigDecimal based on the supplied MathContext.
override def byteValue : Byte
Converts this BigDecimal to a byte. If the BigDecimal is too big to fit in a byte, only the low-order 8 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
def byteValueExact : Byte
This BigDecimal as an exact value.
def charValue : Char
Converts this BigDecimal to a char. If the BigDecimal is too big to fit in a char, only the low-order 16 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value and that it always returns a positive result.
def compare (that : BigDecimal) : Int
Compares this BigDecimal with the specified BigDecimal
def doubleValue : Double
Converts this BigDecimal to a Double. if this BigDecimal has too great a magnitude to represent as a float, it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate.
override def equals (that : Any) : Boolean
Compares this BigDecimal with the specified value for equality. Will only claim equality with scala.BigDecimal and java.math.BigDecimal.
def equals (that : BigDecimal) : Boolean
Compares this BigDecimal with the specified BigDecimal for equality.
def floatValue : Float
Converts this BigDecimal to a float. if this BigDecimal has too great a magnitude to represent as a float, it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate.
override def hashCode : Int
Returns the hash code for this BigDecimal.
def intValue : Int
Converts this BigDecimal to an int. If the BigDecimal is too big to fit in a char, only the low-order 32 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
def intValueExact : Int
def longValue : Long
Converts this BigDecimal to a Long. If the BigDecimal is too big to fit in a char, only the low-order 64 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
def longValueExact : Long
def max (that : BigDecimal) : BigDecimal
Returns the maximum of this and that
def min (that : BigDecimal) : BigDecimal
Returns the minimum of this and that
def pow (n : Int) : BigDecimal
Returns a BigDecimal whose value is this* n.
def precision : Int
Returns the precision of this BigDecimal.
def quot (that : BigDecimal) : BigDecimal
Divide to Integral value.
def remainder (that : BigDecimal) : BigDecimal
Remainder after dividing this by that.
def round (mc : java.math.MathContext) : BigDecimal
Returns a BigDecimal rounded according to the MathContext settings.
def scale : Int
Returns the scale of this BigDecimal.
def setScale (scale : Int, mode : Value) : BigDecimal
def setScale (scale : Int) : BigDecimal
Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to this BigDecimal's.
override def shortValue : Short
Converts this BigDecimal to a short. If the BigDecimal is too big to fit in a byte, only the low-order 16 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
def shortValueExact : Short
def signum : Int
Returns the sign of this BigDecimal, i.e. -1 if it is less than 0, +1 if it is greater than 0 0 if it is equal to 0
def to (end : BigDecimal) : Partial[BigDecimal, Inclusive[BigDecimal]]
Like until, but inclusive of the end value.
def to (end : BigDecimal, step : BigDecimal) : Inclusive[BigDecimal]
Like until, but inclusive of the end value.
def toBigInt : BigInt
Converts this BigDecimal to a scala.BigInt.
def toBigIntExact : Option[BigInt]
Converts this BigDecimal to a scala.BigInt if it can be done losslessly, returning Some(BigInt) or None.
override def toString : java.lang.String
Returns the decimal String representation of this BigDecimal.
def ulp : BigDecimal
Returns the size of an ulp, a unit in the last place, of this BigDecimal.
def unary_- : BigDecimal
Returns a BigDecimal whose value is the negation of this BigDecimal
def until (end : BigDecimal) : Partial[BigDecimal, Exclusive[BigDecimal]]
Creates a partially constructed GenericRange[BigDecimal] in range [start;end), where start is the target BigDecimal. The step must be supplied via the "by" method of the returned object in order to receive the fully constructed range. For example:
   val partial = BigDecimal(1.0) to 2.0       // not usable yet
   val range = partial by 0.01                // now a GenericRange
   val range2 = BigDecimal(0) to 1.0 by 0.01  // all at once of course is fine too
   
def until (end : BigDecimal, step : BigDecimal) : Exclusive[BigDecimal]
Same as the one-argument until, but creates the range immediately.
Methods inherited from AnyRef
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Additional Constructor Details
def this(bigDecimal : java.math.BigDecimal) : BigDecimal

Method Details
override def hashCode : Int
Returns the hash code for this BigDecimal.

override def equals(that : Any) : Boolean
Compares this BigDecimal with the specified value for equality. Will only claim equality with scala.BigDecimal and java.math.BigDecimal.

def equals(that : BigDecimal) : Boolean
Compares this BigDecimal with the specified BigDecimal for equality.

def compare(that : BigDecimal) : Int
Compares this BigDecimal with the specified BigDecimal

def <=(that : BigDecimal) : Boolean
Less-than-or-equals comparison of BigDecimals

def >=(that : BigDecimal) : Boolean
Greater-than-or-equals comparison of BigDecimals

def <(that : BigDecimal) : Boolean
Less-than of BigDecimals

def >(that : BigDecimal) : Boolean
Greater-than comparison of BigDecimals

def +(that : BigDecimal) : BigDecimal
Addition of BigDecimals

def -(that : BigDecimal) : BigDecimal
Subtraction of BigDecimals

def *(that : BigDecimal) : BigDecimal
Multiplication of BigDecimals

def /(that : BigDecimal) : BigDecimal
Division of BigDecimals

def /%(that : BigDecimal) : (BigDecimal, BigDecimal)
Division and Remainder - returns tuple containing the result of divideToIntegralValue and the remainder.

def quot(that : BigDecimal) : BigDecimal
Divide to Integral value.

def min(that : BigDecimal) : BigDecimal
Returns the minimum of this and that

def max(that : BigDecimal) : BigDecimal
Returns the maximum of this and that

def remainder(that : BigDecimal) : BigDecimal
Remainder after dividing this by that.

def pow(n : Int) : BigDecimal
Returns a BigDecimal whose value is this* n.

def unary_- : BigDecimal
Returns a BigDecimal whose value is the negation of this BigDecimal

def abs : BigDecimal
Returns the absolute value of this BigDecimal

def signum : Int
Returns the sign of this BigDecimal, i.e. -1 if it is less than 0, +1 if it is greater than 0 0 if it is equal to 0

def precision : Int
Returns the precision of this BigDecimal.

def round(mc : java.math.MathContext) : BigDecimal
Returns a BigDecimal rounded according to the MathContext settings.

def scale : Int
Returns the scale of this BigDecimal.

def ulp : BigDecimal
Returns the size of an ulp, a unit in the last place, of this BigDecimal.

def apply(mc : java.math.MathContext) : BigDecimal
Returns a new BigDecimal based on the supplied MathContext.

def setScale(scale : Int) : BigDecimal
Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to this BigDecimal's.

def setScale(scale : Int, mode : Value) : BigDecimal

override def byteValue : Byte
Converts this BigDecimal to a byte. If the BigDecimal is too big to fit in a byte, only the low-order 8 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
Overrides
java.lang.Number.java.lang.Number.byteValue

override def shortValue : Short
Converts this BigDecimal to a short. If the BigDecimal is too big to fit in a byte, only the low-order 16 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
Overrides
java.lang.Number.java.lang.Number.shortValue

def charValue : Char
Converts this BigDecimal to a char. If the BigDecimal is too big to fit in a char, only the low-order 16 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value and that it always returns a positive result.

def intValue : Int
Converts this BigDecimal to an int. If the BigDecimal is too big to fit in a char, only the low-order 32 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
Overrides
java.lang.Number.java.lang.Number.intValue

def longValue : Long
Converts this BigDecimal to a Long. If the BigDecimal is too big to fit in a char, only the low-order 64 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigDecimal value as well as return a result with the opposite sign.
Overrides
java.lang.Number.java.lang.Number.longValue

def floatValue : Float
Converts this BigDecimal to a float. if this BigDecimal has too great a magnitude to represent as a float, it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate.
Overrides
java.lang.Number.java.lang.Number.floatValue

def doubleValue : Double
Converts this BigDecimal to a Double. if this BigDecimal has too great a magnitude to represent as a float, it will be converted to Float.NEGATIVE_INFINITY or Float.POSITIVE_INFINITY as appropriate.
Overrides
java.lang.Number.java.lang.Number.doubleValue

def byteValueExact : Byte
This BigDecimal as an exact value.

def shortValueExact : Short

def intValueExact : Int

def longValueExact : Long

def until(end : BigDecimal) : Partial[BigDecimal, Exclusive[BigDecimal]]
Creates a partially constructed GenericRange[BigDecimal] in range [start;end), where start is the target BigDecimal. The step must be supplied via the "by" method of the returned object in order to receive the fully constructed range. For example:
   val partial = BigDecimal(1.0) to 2.0       // not usable yet
   val range = partial by 0.01                // now a GenericRange
   val range2 = BigDecimal(0) to 1.0 by 0.01  // all at once of course is fine too
   
Parameters
end - the end value of the range (exclusive)
Returns
the partially constructed GenericRange

def until(end : BigDecimal, step : BigDecimal) : Exclusive[BigDecimal]
Same as the one-argument until, but creates the range immediately.

def to(end : BigDecimal) : Partial[BigDecimal, Inclusive[BigDecimal]]
Like until, but inclusive of the end value.

def to(end : BigDecimal, step : BigDecimal) : Inclusive[BigDecimal]
Like until, but inclusive of the end value.

def toBigInt : BigInt
Converts this BigDecimal to a scala.BigInt.

def toBigIntExact : Option[BigInt]
Converts this BigDecimal to a scala.BigInt if it can be done losslessly, returning Some(BigInt) or None.

override def toString : java.lang.String
Returns the decimal String representation of this BigDecimal.