sealed abstract class BiggerDecimal extends Serializable
Represents a large decimal number.
In theory BigDecimal
can represent a very large range of valid JSON numbers (in most cases if a
JSON number string can fit in memory, it's possible to construct an exact BigDecimal
representation), but in practice this becomes intractable for many small JSON numbers (e.g.
"1e2147483648" cannot be directly parsed as a BigDecimal
).
This type makes it possible to represent much, much larger numbers efficiently (although it
doesn't support many operations on these values). It also makes it possible to distinguish
between positive and negative zeros (unlike BigDecimal
), which may be useful in some
applications.
- Source
- BiggerDecimal.scala
- Alphabetic
- By Inheritance
- BiggerDecimal
- Serializable
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def isNegativeZero: Boolean
- abstract def isWhole: Boolean
- abstract def signum: Int
The sign of this value.
The sign of this value.
Returns -1 if it is less than 0, +1 if it is greater than 0, and 0 if it is equal to 0. Note that this follows the behavior of scala.Double for negative zero (returning 0).
- abstract def toBigDecimal: Option[BigDecimal]
Convert to a
java.math.BigDecimal
if thescale
is within the range of scala.Int. - abstract def toBigIntegerWithMaxDigits(maxDigits: BigInteger): Option[BigInteger]
Convert to a
java.math.BigInteger
if this is a sufficiently small whole number. - abstract def toDouble: Double
Convert to the nearest scala.Double.
- abstract def toFloat: Float
Convert to the nearest scala.Float.
- abstract def toLong: Option[Long]
Convert to a scala.Long if this is a valid
Long
value.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toany2stringadd[BiggerDecimal] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (BiggerDecimal, B)
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toArrowAssoc[BiggerDecimal] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def ensuring(cond: (BiggerDecimal) => Boolean, msg: => Any): BiggerDecimal
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toEnsuring[BiggerDecimal] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (BiggerDecimal) => Boolean): BiggerDecimal
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toEnsuring[BiggerDecimal] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): BiggerDecimal
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toEnsuring[BiggerDecimal] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): BiggerDecimal
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toEnsuring[BiggerDecimal] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toStringFormat[BiggerDecimal] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toBigInteger: Option[BigInteger]
Convert to a
java.math.BigInteger
if this is a sufficiently small whole number.Convert to a
java.math.BigInteger
if this is a sufficiently small whole number.The maximum number of digits is somewhat arbitrarily set at 2^18 digits, since larger values may require excessive processing power. Larger values may be converted to
BigInteger
with toBigIntegerWithMaxDigits or via toBigDecimal. - def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def →[B](y: B): (BiggerDecimal, B)
- Implicit
- This member is added by an implicit conversion from BiggerDecimal toArrowAssoc[BiggerDecimal] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.