gnu.kawa.functions
Class ArithOp
java.lang.Object
gnu.mapping.PropertySet
gnu.mapping.Procedure
gnu.mapping.ProcedureN
gnu.kawa.functions.ArithOp
- All Implemented Interfaces:
- Named
- Direct Known Subclasses:
- AddOp, BitwiseOp, DivideOp, MultiplyOp
public abstract class ArithOp
- extends ProcedureN
Constructor Summary |
ArithOp(java.lang.String name,
int op)
|
Method Summary |
static int |
classify(Type type)
Classify an expression according to its numeric type. |
java.lang.Object |
defaultResult()
|
boolean |
isSideEffectFree()
True if this Procedure (definitely) has no side-effects. |
Methods inherited from class gnu.mapping.Procedure |
apply, apply, check0, check1, check2, check3, check4, checkArgCount, checkN, getReturnType, getSetter, getSourceLocation, match0, match1, match2, match3, match4, matchN, maxArgs, maxArgs, minArgs, minArgs, numArgs, set0, set1, setN, setSetter, setSourceLocation, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DIVIDE_GENERIC
public static final int DIVIDE_GENERIC
- Implement's Scheme
/
operation.
- See Also:
- Constant Field Values
DIVIDE_INEXACT
public static final int DIVIDE_INEXACT
- Implements a division operation.
Like Scheme's
(exact->inexact (/ x y))
.
- See Also:
- Constant Field Values
QUOTIENT
public static final int QUOTIENT
- Implements a quotient operation.
Depends on the value of
getRoundingMode()
.
Operands are real; result is an integer.
Inexact operands yield inexact integer result.
- See Also:
- Constant Field Values
QUOTIENT_EXACT
public static final int QUOTIENT_EXACT
- Implements a quotient operation.
Depends on the value of
getRoundingMode()
.
Operands and result are real.
Operands are real; result is an integer.
Inexact operands yield exact integer result.
- See Also:
- Constant Field Values
MODULO
public static final int MODULO
- Implements a modulo/remainder operation.
Depends on the value of
getRoundingMode()
.
Operands and result are real.
- See Also:
- Constant Field Values
ASHIFT_GENERAL
public static final int ASHIFT_GENERAL
- See Also:
- Constant Field Values
ASHIFT_LEFT
public static final int ASHIFT_LEFT
- See Also:
- Constant Field Values
ASHIFT_RIGHT
public static final int ASHIFT_RIGHT
- See Also:
- Constant Field Values
LSHIFT_RIGHT
public static final int LSHIFT_RIGHT
- See Also:
- Constant Field Values
AND
public static final int AND
- See Also:
- Constant Field Values
IOR
public static final int IOR
- See Also:
- Constant Field Values
XOR
public static final int XOR
- See Also:
- Constant Field Values
NOT
public static final int NOT
- See Also:
- Constant Field Values
ArithOp
public ArithOp(java.lang.String name,
int op)
defaultResult
public java.lang.Object defaultResult()
isSideEffectFree
public boolean isSideEffectFree()
- Description copied from class:
Procedure
- True if this Procedure (definitely) has no side-effects.
Note side-effect-free does not imply idempotent if this
allocates an object with "identity".
- Overrides:
isSideEffectFree
in class Procedure
classify
public static int classify(Type type)
- Classify an expression according to its numeric type.
kind==0: not a number.
kind==1: a non-real number
kind==2: real number
kind==3: floating-point
kind==4: exact integer