BiggerDecimal

io.circe.numbers.BiggerDecimal
See theBiggerDecimal companion object
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.

Attributes

Companion
object
Source
BiggerDecimal.scala
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

Attributes

Source
BiggerDecimal.scala

Attributes

Source
BiggerDecimal.scala
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).

Attributes

Source
BiggerDecimal.scala

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

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

Attributes

Source
BiggerDecimal.scala

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.

Attributes

Source
BiggerDecimal.scala

Convert to the nearest scala.Double.

Convert to the nearest scala.Double.

Attributes

Source
BiggerDecimal.scala
def toFloat: Float

Convert to the nearest scala.Float.

Convert to the nearest scala.Float.

Attributes

Source
BiggerDecimal.scala

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

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

Attributes

Source
BiggerDecimal.scala

Concrete methods

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.

Attributes

Source
BiggerDecimal.scala