com.trassare.calculator.engine
Class Operation
java.lang.Object
com.trassare.calculator.engine.Operation
public final class Operation
- extends Object
This class contains the mathematical operations that are not native to the
BigDecimal class. By placing them in this class, the InfixCalculator's
primary purpose is to parse the expression.
- Version:
- 8 September 2006
- Author:
- Samuel T Trassare
|
Field Summary |
protected static int |
BASE_TEN
The base-10 constant for logarithmic operations. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BASE_TEN
protected static final int BASE_TEN
- The base-10 constant for logarithmic operations.
- See Also:
- Constant Field Values
acos
protected static BigDecimal acos(BigDecimal bd)
throws Operation.OperationException
- Parameters:
bd - The number to which the arccosine operation will be applied.
- Returns:
- the arccosine of the input number
- Throws:
Operation.OperationException - if the input value > 1 an OperationException is thrown
asin
protected static BigDecimal asin(BigDecimal bd)
throws Operation.OperationException
- Parameters:
bd - The number to which the arcsine operation will be applied.
- Returns:
- the arcsine of the input number
- Throws:
Operation.OperationException - if the input value > 1 an OperationException is thrown
atan
protected static BigDecimal atan(BigDecimal bd)
- Parameters:
bd - The number to which the arctangent operation will be applied.
- Returns:
- the arctangent of the input number
cos
protected static BigDecimal cos(BigDecimal bd)
- Parameters:
bd - The number to which the cosine operation will be applied.
- Returns:
- the cosine of the input number
ln
protected static BigDecimal ln(BigDecimal bd)
- Parameters:
bd - The number to which the natural log operation will be applied.
- Returns:
- the natural logarithm of the input number
sin
protected static BigDecimal sin(BigDecimal bd)
- Parameters:
bd - The number to which the sine operation will be applied.
- Returns:
- the sine of the input number
tan
protected static BigDecimal tan(BigDecimal bd)
throws Operation.OperationException
- Parameters:
bd - The number to which the tangent operation will be applied.
- Returns:
- the tangent of the input number
- Throws:
Operation.OperationException - The input number cannot be a factor of PI/2