public class Binomial extends PostfixMathCommand
For efficiency the binomial coefficients are stored in a static array.
curNumberOfParameters, numberOfParameters
Constructor and Description |
---|
Binomial() |
Modifier and Type | Method and Description |
---|---|
static int |
binom(int n,
int i)
Returns the binomial coefficients.
|
void |
run(java.util.Stack s)
Throws an exception because this method should never be called under
normal circumstances.
|
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameters
public void run(java.util.Stack s) throws ParseException
PostfixMathCommand
run
in interface PostfixMathCommandI
run
in class PostfixMathCommand
ParseException
public static int binom(int n, int i) throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
- if n<0, i<0 or i>nhttp://www.singularsys.com/jep Copyright © 2007 Singular Systems