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(Stack s)
Throws an exception because this method should never be called under
normal circumstances.
|
checkNumberOfParameters, checkStack, getNumberOfParameters, setCurNumberOfParameterspublic void run(Stack s) throws ParseException
PostfixMathCommandrun in interface PostfixMathCommandIrun in class PostfixMathCommandParseExceptionpublic static int binom(int n,
int i)
throws ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsException - if n<0, i<0 or i>nCopyright © 2018. All rights reserved.