org.nfunk.jep.function
Class SquareRoot
java.lang.Object
org.nfunk.jep.function.PostfixMathCommand
org.nfunk.jep.function.SquareRoot
- All Implemented Interfaces:
- PostfixMathCommandI
public class SquareRoot
- extends PostfixMathCommand
|
Method Summary |
void |
run(Stack inStack)
Applies the function to the parameters on the stack. |
Object |
sqrt(Object param)
Calculates the square root of the parameter. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SquareRoot
public SquareRoot()
run
public void run(Stack inStack)
throws ParseException
- Applies the function to the parameters on the stack.
- Specified by:
run in interface PostfixMathCommandI- Overrides:
run in class PostfixMathCommand
- Throws:
ParseException
sqrt
public Object sqrt(Object param)
throws ParseException
- Calculates the square root of the parameter. The parameter must
either be of type Double or Complex.
- Returns:
- The square root of the parameter.
- Throws:
ParseException
Copyright © 2014. All rights reserved.