gnu.kawa.functions
Class ArithOp

java.lang.Object
  extended by gnu.mapping.PropertySet
      extended by gnu.mapping.Procedure
          extended by gnu.mapping.ProcedureN
              extended by gnu.kawa.functions.ArithOp
All Implemented Interfaces:
Named
Direct Known Subclasses:
AddOp, BitwiseOp, DivideOp, MultiplyOp

public abstract class ArithOp
extends ProcedureN


Field Summary
static int AND
           
static int ASHIFT_GENERAL
           
static int ASHIFT_LEFT
           
static int ASHIFT_RIGHT
           
static int DIVIDE_GENERIC
          Implement's Scheme / operation.
static int DIVIDE_INEXACT
          Implements a division operation.
static int IOR
           
static int LSHIFT_RIGHT
           
static int MODULO
          Implements a modulo/remainder operation.
static int NOT
           
static int QUOTIENT
          Implements a quotient operation.
static int QUOTIENT_EXACT
          Implements a quotient operation.
static int XOR
           
 
Fields inherited from class gnu.mapping.ProcedureN
noArgs
 
Fields inherited from class gnu.mapping.Procedure
compilerKey, validateApplyKey
 
Fields inherited from class gnu.mapping.PropertySet
nameKey
 
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.ProcedureN
apply0, apply1, apply2, apply3, apply4, applyN
 
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 gnu.mapping.PropertySet
getName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

ArithOp

public ArithOp(java.lang.String name,
               int op)
Method Detail

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