# BigDecimal

opaque type BigDecimal

### Big BigDecimal

BigDecimal is an opaque value holding java.math.BigDecimal

BigDecimal is used for really large floating point calculations

`````` // Calculate number Pi using Nilakantha series

Stream(2.0.Big)
.unfold(_.last + 4)
.takeFirst(1000) // the more - the better
.map(v => (4.0.Big / (v * (v + 1) * (v + 2)) - 4.0.Big / ((v + 2) * (v + 3) * (v + 4))))
.fold(3.0.Big)(_ + _)
.tp

// Prints: 3.1415926535585900763679167025419016466613791096007613231066955478
``````
Source
BigDecimal.scala

## Def

@targetName("remainder")
inline def %(v: Double | BigDecimal): BigDecimal
@targetName("multiply")
inline def *(v: Double | BigDecimal): BigDecimal
@targetName("plus")
inline def +(v: Double | BigDecimal): BigDecimal
@targetName("minus")
inline def -(v: Double | BigDecimal): BigDecimal
@targetName("divide")
inline def /(v: Double | BigDecimal)(using r: Math.Rounding): BigDecimal
@targetName("less")
inline def <(v: Double | BigDecimal): Boolean
@targetName("lessOrEqual")
inline def <=(v: Double | BigDecimal): Boolean
@targetName("greater")
inline def >(v: Double | BigDecimal): Boolean
@targetName("greaterOrEqual")
inline def >=(v: Double | BigDecimal): Boolean
inline def abs
inline def real: java.math.BigDecimal

Real value

Real value

Returns real value standing behind the opaque type.

This is a zero cost call.

Inherited from
_methods
Source
Base.scala
inline def roundToDecimal(v: Int)(using r: Math.Rounding): BigDecimal

Round to decimal

Round to decimal

Rounds current value to specified decimal position of fractional value

Source
BigDecimal.scala
inline def sign: Int
inline def toDouble: Double
inline def toNumber: java.math.BigDecimal
inline def unary_-