com.klg.jclass.util.formulae
Class Round
java.lang.Object
|
+--com.klg.jclass.util.formulae.Operation
|
+--com.klg.jclass.util.formulae.Round
- All Implemented Interfaces:
- Cloneable, Expression
- public class Round
- extends Operation
This is a concrete implementation for the round operation.
Round is defined as nearest integer, with rounding done to
an even number if the operand is exactly between two integers.
This is a unary operator, *???but can also work on lists???*.
Constructor Summary |
Round(com.klg.jclass.util.formulae.Expression operand)
Define a rounding operation on the given Expression |
Round(Number operand)
Define a rounding operation on the given Number |
Method Summary |
com.klg.jclass.util.formulae.Result |
evaluate()
Return the nearest integer to the given value |
Methods inherited from class com.klg.jclass.util.formulae.Operation |
clone |
Round
public Round(com.klg.jclass.util.formulae.Expression operand)
- Define a rounding operation on the given Expression
Round
public Round(Number operand)
- Define a rounding operation on the given Number
evaluate
public com.klg.jclass.util.formulae.Result evaluate()
- Return the nearest integer to the given value
- Specified by:
evaluate
in interface Expression
- Specified by:
evaluate
in class Operation
- Returns:
- The rounded value of the given operand