Class/Object

io.circe.numbers

BiggerDecimal

Related Docs: object BiggerDecimal | package numbers

Permalink

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.

Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BiggerDecimal
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def isNegativeZero: Boolean

    Permalink
  2. abstract def isWhole: Boolean

    Permalink
  3. abstract def signum: Int

    Permalink

    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).

  4. abstract def toBigDecimal: Option[BigDecimal]

    Permalink

    Convert to a java.math.BigDecimal if the scale is within the range of scala.Int.

  5. abstract def toBigIntegerWithMaxDigits(maxDigits: BigInteger): Option[BigInteger]

    Permalink

    Convert to a java.math.BigInteger if this is a sufficiently small whole number.

  6. abstract def toDouble: Double

    Permalink

    Convert to the nearest scala.Double.

  7. abstract def toLong: Option[Long]

    Permalink

    Convert to a scala.Long if this is a valid Long value.

  8. abstract def truncateToLong: Long

    Permalink

    Convert to the nearest scala.Long.

    Convert to the nearest scala.Long.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.9.0) Use toBigDecimal

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. final def toBigInteger: Option[BigInteger]

    Permalink

    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.

  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped