TSTypesImpl.mesa
Michael Plass, November 2, 1982 10:09 am
Last Edited by: Beach, May 24, 1983 9:08 am
DIRECTORY TSTypes, Real USING [RoundI];
TSTypesImpl: CEDAR PROGRAM IMPORTS Real EXPORTS TSTypes =
BEGIN OPEN TSTypes;
DimnInt: PUBLIC PROCEDURE [num,denom: Dimn] RETURNS [INTEGER] =
BEGIN
t:REAL←num.texPts/denom.texPts;
s:INTEGER ← 1;
IF t<0 THEN {t ← -t; s ← -s};
IF t<=LAST[NAT] THEN RETURN[s*Real.RoundI[t]]
ELSE RETURN[s*LAST[NAT]]
END;
END.
Michael Plass, November 2, 1982 10:10 am. CEDARized.