public class RInt extends Round
RInt differs from the Round class in that it uses the Math.rint() method rather than Math.round(). Unlike Math.round(), in the case of a tie (e.g 1.5) Math.rint() prefers the nearest even integer (so rint(1.5) = 2). This has better statistical properties. For the two argument version you can consider it as a rounding method with a mode of round-half-even.
Round
,
Serialized FormcurNumberOfParameters, name, NaN, numberOfParameters
Constructor and Description |
---|
RInt() |
Modifier and Type | Method and Description |
---|---|
protected double |
rint(double param) |
java.lang.Object |
round(java.lang.Object arg) |
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
protected double rint(double param)
public java.lang.Object round(java.lang.Object arg) 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