org.nfunk.jep.function
Class SquareRoot

java.lang.Object
  extended by org.nfunk.jep.function.PostfixMathCommand
      extended by org.nfunk.jep.function.SquareRoot
All Implemented Interfaces:
PostfixMathCommandI

public class SquareRoot
extends PostfixMathCommand


Field Summary
 
Fields inherited from class org.nfunk.jep.function.PostfixMathCommand
curNumberOfParameters, numberOfParameters
 
Constructor Summary
SquareRoot()
           
 
Method Summary
 void run(java.util.Stack inStack)
          Applies the function to the parameters on the stack.
 java.lang.Object sqrt(java.lang.Object param)
          Calculates the square root of the parameter.
 
Methods inherited from class org.nfunk.jep.function.PostfixMathCommand
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SquareRoot

public SquareRoot()
Method Detail

run

public void run(java.util.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 java.lang.Object sqrt(java.lang.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


http://www.singularsys.com/jep Copyright © 2007 Singular Systems