org.hecl
Class MathCmds
java.lang.Object
org.hecl.Operator
org.hecl.MathCmds
- All Implemented Interfaces:
- Command
public class MathCmds
- extends Operator
The MathCmds
class implements a variety of math
commands, depending on which version of Java Hecl is compiled for.
- Version:
- 1.0
Constructor Summary |
protected |
MathCmds(int cmdcode,
int minargs,
int maxargs)
|
Method Summary |
static Thing |
binary(int cmdcode,
Interp ip,
NumberThing a,
NumberThing b)
|
protected static int |
compare(double v1,
double v2)
|
protected static int |
compare(int v1,
int v2)
|
protected static int |
compare(long v1,
long v2)
|
static int |
compare(NumberThing a,
NumberThing b)
|
static int |
compare(Thing a,
Thing b)
|
static void |
load(Interp ip)
|
Thing |
operate(int cmdcode,
Interp ip,
Thing[] argv)
The operate method dispatches to the actual code. |
static Thing |
unary(int cmdcode,
Interp ip,
NumberThing a)
|
static void |
unload(Interp ip)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
E
public static final Thing E
PI
public static final Thing PI
CASTINT
public static final int CASTINT
- See Also:
- Constant Field Values
CASTLONG
public static final int CASTLONG
- See Also:
- Constant Field Values
CASTFLOAT
public static final int CASTFLOAT
- See Also:
- Constant Field Values
CASTDOUBLE
public static final int CASTDOUBLE
- See Also:
- Constant Field Values
TODEGREES
public static final int TODEGREES
- See Also:
- Constant Field Values
TORADIANS
public static final int TORADIANS
- See Also:
- Constant Field Values
ABS
public static final int ABS
- See Also:
- Constant Field Values
SQRT
public static final int SQRT
- See Also:
- Constant Field Values
LOG
public static final int LOG
- See Also:
- Constant Field Values
SIN
public static final int SIN
- See Also:
- Constant Field Values
COS
public static final int COS
- See Also:
- Constant Field Values
TAN
public static final int TAN
- See Also:
- Constant Field Values
ASIN
public static final int ASIN
- See Also:
- Constant Field Values
ACOS
public static final int ACOS
- See Also:
- Constant Field Values
ATAN
public static final int ATAN
- See Also:
- Constant Field Values
EXP
public static final int EXP
- See Also:
- Constant Field Values
FLOOR
public static final int FLOOR
- See Also:
- Constant Field Values
CEIL
public static final int CEIL
- See Also:
- Constant Field Values
POW
public static final int POW
- See Also:
- Constant Field Values
RANDOM
public static final int RANDOM
- See Also:
- Constant Field Values
ROUND
public static final int ROUND
- See Also:
- Constant Field Values
MIN
public static final int MIN
- See Also:
- Constant Field Values
MAX
public static final int MAX
- See Also:
- Constant Field Values
SIGNUM
public static final int SIGNUM
- See Also:
- Constant Field Values
CBRT
public static final int CBRT
- See Also:
- Constant Field Values
LOG10
public static final int LOG10
- See Also:
- Constant Field Values
LOG1P
public static final int LOG1P
- See Also:
- Constant Field Values
SINH
public static final int SINH
- See Also:
- Constant Field Values
COSH
public static final int COSH
- See Also:
- Constant Field Values
TANH
public static final int TANH
- See Also:
- Constant Field Values
EXPM1
public static final int EXPM1
- See Also:
- Constant Field Values
HYPOT
public static final int HYPOT
- See Also:
- Constant Field Values
INCR
public static final int INCR
- See Also:
- Constant Field Values
DECR
public static final int DECR
- See Also:
- Constant Field Values
TRUE
public static final int TRUE
- See Also:
- Constant Field Values
FALSE
public static final int FALSE
- See Also:
- Constant Field Values
NOT
public static final int NOT
- See Also:
- Constant Field Values
AND
public static final int AND
- See Also:
- Constant Field Values
OR
public static final int OR
- See Also:
- Constant Field Values
EQ
public static final int EQ
- See Also:
- Constant Field Values
NEQ
public static final int NEQ
- See Also:
- Constant Field Values
LT
public static final int LT
- See Also:
- Constant Field Values
LE
public static final int LE
- See Also:
- Constant Field Values
GT
public static final int GT
- See Also:
- Constant Field Values
GE
public static final int GE
- See Also:
- Constant Field Values
BINADD
public static final int BINADD
- See Also:
- Constant Field Values
BINSUB
public static final int BINSUB
- See Also:
- Constant Field Values
BINMUL
public static final int BINMUL
- See Also:
- Constant Field Values
BINDIV
public static final int BINDIV
- See Also:
- Constant Field Values
MOD
public static final int MOD
- See Also:
- Constant Field Values
PLUS
public static final int PLUS
- See Also:
- Constant Field Values
MINUS
public static final int MINUS
- See Also:
- Constant Field Values
MUL
public static final int MUL
- See Also:
- Constant Field Values
MathCmds
protected MathCmds(int cmdcode,
int minargs,
int maxargs)
compare
public static int compare(Thing a,
Thing b)
compare
public static int compare(NumberThing a,
NumberThing b)
unary
public static Thing unary(int cmdcode,
Interp ip,
NumberThing a)
throws HeclException
- Throws:
HeclException
binary
public static Thing binary(int cmdcode,
Interp ip,
NumberThing a,
NumberThing b)
throws HeclException
- Throws:
HeclException
operate
public Thing operate(int cmdcode,
Interp ip,
Thing[] argv)
throws HeclException
- Description copied from class:
Operator
- The
operate
method dispatches to the actual code.
- Specified by:
operate
in class Operator
- Parameters:
cmdcode
- an int
valueip
- an Interp
valueargv
- a Thing[]
value
- Returns:
- a
Thing
value, or null when no value has been
- Throws:
HeclException
- if an error occurs
load
public static void load(Interp ip)
throws HeclException
- Throws:
HeclException
unload
public static void unload(Interp ip)
throws HeclException
- Throws:
HeclException
compare
protected static int compare(int v1,
int v2)
compare
protected static int compare(long v1,
long v2)
compare
protected static int compare(double v1,
double v2)