com.klg.jclass.util.formulae
Class Trunc
java.lang.Object
|
+--com.klg.jclass.util.formulae.Operation
|
+--com.klg.jclass.util.formulae.Trunc
- All Implemented Interfaces:
- Cloneable, Expression
- public class Trunc
- extends Operation
This is a concrete implementation for the trunc (truncation)
operation. Trunc is also known as "integer part," the result
is equivalent to "round to zero," since it rounds to the nearest
integer closer to zero.
This is a unary operator, *???but can also work on lists???*.
Constructor Summary |
Trunc(com.klg.jclass.util.formulae.Expression operand)
Define a truncation operation on the given Expression |
Trunc(Number operand)
Define a truncation operation on the given Number |
Method Summary |
com.klg.jclass.util.formulae.Result |
evaluate()
Return the integer part of a given number (round to zero) |
Methods inherited from class com.klg.jclass.util.formulae.Operation |
clone |
Trunc
public Trunc(com.klg.jclass.util.formulae.Expression operand)
- Define a truncation operation on the given Expression
Trunc
public Trunc(Number operand)
- Define a truncation operation on the given Number
evaluate
public com.klg.jclass.util.formulae.Result evaluate()
- Return the integer part of a given number (round to zero)
- Specified by:
evaluate
in interface Expression
- Specified by:
evaluate
in class Operation
- Returns:
- The integer part of the given operand