-- SpecialReal.mesa
-- Last edit by Doug Wyatt, August 27, 1982 2:04 pm
DIRECTORY
Ieee USING [ExponentBias, SingleReal],
Real USING [FScale, RoundLI];
SpecialReal: CEDAR DEFINITIONS IMPORTS Real = {
Half: PROC[r: REAL] RETURNS[REAL] = TRUSTED INLINE {
RETURN[Real.FScale[r, -1]] };
Round: PROC[r: REAL] RETURNS[REAL] = INLINE {
IF LOOPHOLE[r,Ieee.SingleReal].exp<(Ieee.ExponentBias+31)
THEN TRUSTED { RETURN[Real.RoundLI[r]] } ELSE RETURN[r] };
Small: PROC[r: REAL] RETURNS[BOOLEAN] = INLINE {
RETURN[LOOPHOLE[r, Ieee.SingleReal].exp<(Ieee.ExponentBias+23)] };
-- If ~Small[r], r must represent a (large) integer.
}.