|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.Round
com.singularsys.jep.functions.RInt
public class RInt
A PostfixMathCommandI which rounds a number to the closest integer.
rint(2.4) finds the closest integer to the argument (2).
rint(2.1234, 3) rounds the argument to 3 decimal places (2.123).
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.
Round,
Serialized Form| Field Summary |
|---|
| Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand |
|---|
curNumberOfParameters, name, NaN, numberOfParameters |
| Constructor Summary | |
|---|---|
RInt()
|
|
| Method Summary | |
|---|---|
protected double |
round(double param)
The rounding method which implements the core rounding operation used in this class. |
| Methods inherited from class com.singularsys.jep.functions.Round |
|---|
checkNumberOfParameters, round, run |
| Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand |
|---|
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkStack, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RInt()
| Method Detail |
|---|
protected double round(double param)
Round
round in class Round
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||