IPReal.mesa
Copyright © 1984, 1985 Xerox Corporation. All rights reserved.
Doug Wyatt, May 20, 1985 2:01:32 pm PDT
Michael Plass, June 22, 1985 8:25:05 pm PDT
IPReal: CEDAR DEFINITIONS
~ BEGIN
Floor: PROC [a: REAL] RETURNS [REAL];
Ceiling: PROC [a: REAL] RETURNS [REAL];
Trunc: PROC [a: REAL] RETURNS [REAL];
Round: PROC [a: REAL] RETURNS [REAL];
Mod: PROC [a, b: REAL] RETURNS [REAL];
Rem: PROC [a, b: REAL] RETURNS [REAL];
ShortRational: TYPE ~ RECORD [numerator: INTEGER, denominator: CARDINAL];
ShortRationalFromReal: PROC [real: REAL] RETURNS [ShortRational];
picks a close rational approximation for the real number.
denominator will be zero for out-of-range inputs.
answer is always in lowest terms.
Rational: TYPE ~ RECORD [numerator: INT, denominator: INT];
denominator never negative.
RationalFromReal: PROC [real: REAL] RETURNS [Rational];
picks a close rational approximation for the real number.
denominator will be zero for out-of-range inputs.
answer is always in lowest terms.
END.