Provides absolute and relative approximations to RealLike types that have
mixed in a SeparationBound. The absolute approximations take
BigDecimal for their context, returning a BigDecimal that is equal to
the RealLike +/- the context (error). The relative approximations take a
MathContext specifying how many digits to determine the value of the
RealLike to.
Note that a relative approximation of 0 is always 0.
Here, we mostly work with java.math.BigDecimal as its operations let you
provide a MathContext directly. However, I'm pretty sure that
a.add(b, mc) is equivalent to (a + b).round(mc).
Provides absolute and relative approximations to
RealLike
types that have mixed in aSeparationBound
. The absolute approximations takeBigDecimal
for their context, returning aBigDecimal
that is equal to theRealLike
+/- the context (error). The relative approximations take aMathContext
specifying how many digits to determine the value of theRealLike
to.Note that a relative approximation of 0 is always 0.
Here, we mostly work with
java.math.BigDecimal
as its operations let you provide aMathContext
directly. However, I'm pretty sure thata.add(b, mc)
is equivalent to(a + b).round(mc)
.