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]; Round: PROC [DREAL] RETURNS [DINT]; Ceiling: PROC [DREAL] RETURNS [DINT]; Floor: PROC [DREAL] RETURNS [DINT]; MaxDoublePrecision: CARDINAL = 17; DefaultDoublePrecision: CARDINAL = 15; PairToReal: PROC [fr: DINT, exp10: INTEGER] RETURNS [DREAL]; RealToPair: PROC [r: DREAL, precision: NAT ¬ DefaultDoublePrecision] RETURNS [type: NumberType, fr: DINT, exp10: INTEGER]; END. β DReal.mesa Copyright Σ 1991 by Xerox Corporation. All rights reserved. Michael Plass, August 9, 1991 2:10 pm PDT Operations on DREAL numbers. See IEEE floating point standard for more information. Rounding ... rounds toward zero (mode rz). ... rounds to nearest, unbiased (mode rn). ... rounds toward plus infinity (mode rp). ... rounds toward minus infinity (mode rm). Decimal conversion # of decimal places needed to always exactly reproduce the given real number. # of decimal places that are normally fully significant ... converts the value fr*10**exp10 to real. ... converts value r to fr*10**exp10; fr will have precision significant digits. Michael Plass, August 9, 1991 1:52:52 pm PDT Creation, based on Real.mesa Κό•NewlineDelimiter –(cedarcode) style™codešœ ™ Kšœ Οeœ1™