public class BigDecRound extends Round
RoundingMode
as well as a mode compatible with Math.round(double)
.
Two types of function are supported round(x) rounds to 0 decimal places
and round(x,k) rounds to k decimal places. This can be used to implement
floor() and ceil() functions.
Uses the BigDecimal.setScale(int,RoundingMode)
method.curNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
BigDecRound()
Constructor with a rounding mode matching the behavior or Math.round,
that is it equivalent to Math.floor(a + 0.5d).
|
BigDecRound(java.math.RoundingMode mode)
Constructor with a specified rounding mode.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
round(java.lang.Object l) |
java.lang.Object |
round(java.lang.Object l,
java.lang.Object r) |
checkNumberOfParameters, eval, round, run
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
public BigDecRound()
RoundingMode
.public BigDecRound(java.math.RoundingMode mode)
mode
- public java.lang.Object round(java.lang.Object l) throws EvaluationException
round
in class Round
EvaluationException
public java.lang.Object round(java.lang.Object l, java.lang.Object r) throws EvaluationException
round
in class Round
EvaluationException
Copyright © 2018 Singular Systems http://www.singularsys.com/jep