<<>> <> <> <> <> <> DIRECTORY Real USING [NumberType]; DReal: CEDAR DEFINITIONS = BEGIN OPEN Real; FScale: PROC [a: DREAL, scale: INTEGER] RETURNS [DREAL]; -- a*(2­scale) <> Fix: PROC [DREAL] RETURNS [DINT]; <<... rounds toward zero (mode rz).>> <<>> Round: PROC [DREAL] RETURNS [DINT]; <<... rounds to nearest, unbiased (mode rn).>> <<>> Ceiling: PROC [DREAL] RETURNS [DINT]; <<... rounds toward plus infinity (mode rp).>> <<>> Floor: PROC [DREAL] RETURNS [DINT]; <<... rounds toward minus infinity (mode rm).>> <<>> <> MaxDoublePrecision: CARDINAL = 17; <<# of decimal places needed to always exactly reproduce the given real number.>> DefaultDoublePrecision: CARDINAL = 15; <<# of decimal places that are normally fully significant>> PairToReal: PROC [fr: DINT, exp10: INTEGER] RETURNS [DREAL]; <<... converts the value fr*10**exp10 to real.>> <<>> RealToPair: PROC [r: DREAL, precision: NAT ¬ DefaultDoublePrecision] RETURNS [type: NumberType, fr: DINT, exp10: INTEGER]; <<... converts value r to fr*10**exp10; fr will have precision significant digits.>> <<>> END. <> <>