QCard.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Last edited by Curry, February 6, 1985 7:40:21 pm PST
DIRECTORY
IO;
QCard: CEDAR DEFINITIONS =
BEGIN
QCARD:  TYPE = ARRAY [0..4) OF CARDINALALL[0];
CARD:  TYPE = LONG CARDINAL;
QCError:  SIGNAL[desc: IO.ROPE];
QCZero:  PROC[x: QCARD       ] RETURNS[z: BOOL      ];
QCComp: PROC[x, y: QCARD      ] RETURNS[c: Compare];
QCSftLt:  PROC[x: QCARD, in, size: CARDINAL ] RETURNS[z: QCARD, out: CARDINAL];
QCSftRt:  PROC[x: QCARD, in, size: CARDINAL ] RETURNS[z: QCARD, out: CARDINAL];
QCAdd:  PROC[x, y: QCARD, cIn: CARDINAL ] RETURNS[cOut: CARDINAL, sum: QCARD];
QCSub:  PROC[x, y: QCARD, cIn: CARDINAL ] RETURNS[cOut: CARDINAL, dif: QCARD];
QCDiv:  PROC[num: QCARD, den: CARDINAL] RETURNS[qRes: QCARD, mRes: CARDINAL];
QCDivDbl: PROC[numH,numL, den: QCARD]  RETURNS[qRes: QCARD, mRes: QCARD];
QCMul:  PROC[x: QCARD, y: CARDINAL ] RETURNS[carry: CARDINAL, prod: QCARD];
QCMulDbl: PROC[x: QCARD, y: QCARD  ] RETURNS[   prodH, prodL: QCARD];
QCOut:  PROC[card: CARD]    RETURNS[qcard: QCARD];
QCIn:  PROC[qcard: QCARD]    RETURNS[card: CARD];
QCFromRope: PROC[rope: IO.ROPE, base: [2..36] ← 10] RETURNS[qcard: QCARD];
QCToRope:  PROC[
qcard:   QCARD,
just:   Justification ← right,
fieldWidth: CARDINAL ← 0,
base:   [2..36]   ← 10]
RETURNS[rope: IO.ROPE];
Justification: TYPE = {right, zerofill, left} ← right;
Compare:  TYPE = {eq, gr, ls} ← eq;
END.