next up previous
Next: boolean type Up: The Java type model Previous: Integral types

Numeric types

Arithmetic operations are defined on both integral and floating-point operands. There are no operators that operate exclusively on floating-point operands.

Primitive types[6]:
SET floatingType = [floatType, doubleType];
SET numericType  = integralType + floatingType;
SET numerc2Type  = numericType;

  cmplsOp, cmpgtOp, cmpleOp, cmpgeOp(numericType,numericType): boolType;
  incrOp, decrOp, posOp, negOp(numericType): numericType;
  addOp, subOp, mulOp, divOp, remOp(numericType,numericType): numericType;

  leqInd:        cmpleOp;
  lssInd:        cmplsOp;
  geqInd:        cmpgeOp;
  gtrInd:        cmpgtOp;
  plusplusInd:   incrOp;
  minusminusInd: decrOp;
  plusInd:       posOp, addOp;
  minusInd:      negOp, subOp;
  starInd:       mulOp;
  slashInd:      divOp;
  percentInd:    remOp;
  castInd:       castNumOp;

  (longType): floatType;
  (floatType): doubleType;
This macro is defined in definitions 5, 6, 7, and 8.
This macro is invoked in definition 4.