From: DeaDDooMER Date: Sat, 16 Sep 2017 15:10:00 +0000 (+0300) Subject: Исправлены переводы строк в модуле Reals X-Git-Url: https://deadsoftware.ru/gitweb?a=commitdiff_plain;ds=inline;h=82dcffa336ec4c35e6212ec87482f77fda014978;p=dsw-obn.git Исправлены переводы строк в модуле Reals --- diff --git a/rtl/Reals.obn b/rtl/Reals.obn index 4c9f665..9efd5a2 100644 --- a/rtl/Reals.obn +++ b/rtl/Reals.obn @@ -1 +1,55 @@ -MODULE Reals; (* interface based on Oberon V4 *) IMPORT SYSTEM, CPStrings, CPMath; PROCEDURE Expo*(x: REAL): INTEGER; BEGIN RETURN SHORT(CPMath.Exponent(x)); END Expo; PROCEDURE ExpoL*(x: LONGREAL): INTEGER; BEGIN RETURN SHORT(CPMath.Exponent(x)); END ExpoL; PROCEDURE SetExpo*(e: INTEGER; VAR x: REAL); BEGIN x := SHORT(CPMath.Real(CPMath.Mantissa(x), e)); END SetExpo; PROCEDURE SetExpoL*(e: INTEGER; VAR x: LONGREAL); BEGIN x := CPMath.Real(CPMath.Mantissa(x), e); END SetExpoL; PROCEDURE Ten*(e: INTEGER): REAL; BEGIN RETURN SHORT(CPMath.IntPower(10, e)); END Ten; PROCEDURE TenL*(e: INTEGER): LONGREAL; BEGIN RETURN CPMath.IntPower(10, e); END TenL; PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); BEGIN CPStrings.RealToStringForm(x, n, 0, 3, "0", d); END Convert; PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); BEGIN CPStrings.RealToStringForm(x, n, 0, 3, "0", d); END ConvertL; PROCEDURE ConvertH*(x: REAL; VAR d: ARRAY OF CHAR); BEGIN CPStrings.IntToStringForm(SYSTEM.VAL(LONGINT, x), CPStrings.hexadecimal, 0, "0", FALSE, d); END ConvertH; PROCEDURE ConvertHL*(x: LONGREAL; VAR d: ARRAY OF CHAR); BEGIN CPStrings.IntToStringForm(SYSTEM.VAL(HUGEINT, x), CPStrings.hexadecimal, 0, "0", FALSE, d); END ConvertHL; END Reals. \ No newline at end of file +MODULE Reals; (* interface based on Oberon V4 *) + + IMPORT SYSTEM, CPStrings, CPMath; + + PROCEDURE Expo*(x: REAL): INTEGER; + BEGIN + RETURN SHORT(CPMath.Exponent(x)); + END Expo; + + PROCEDURE ExpoL*(x: LONGREAL): INTEGER; + BEGIN + RETURN SHORT(CPMath.Exponent(x)); + END ExpoL; + + PROCEDURE SetExpo*(e: INTEGER; VAR x: REAL); + BEGIN + x := SHORT(CPMath.Real(CPMath.Mantissa(x), e)); + END SetExpo; + + PROCEDURE SetExpoL*(e: INTEGER; VAR x: LONGREAL); + BEGIN + x := CPMath.Real(CPMath.Mantissa(x), e); + END SetExpoL; + + PROCEDURE Ten*(e: INTEGER): REAL; + BEGIN + RETURN SHORT(CPMath.IntPower(10, e)); + END Ten; + + PROCEDURE TenL*(e: INTEGER): LONGREAL; + BEGIN + RETURN CPMath.IntPower(10, e); + END TenL; + + PROCEDURE Convert*(x: REAL; n: INTEGER; VAR d: ARRAY OF CHAR); + BEGIN + CPStrings.RealToStringForm(x, n, 0, 3, "0", d); + END Convert; + + PROCEDURE ConvertL*(x: LONGREAL; n: INTEGER; VAR d: ARRAY OF CHAR); + BEGIN + CPStrings.RealToStringForm(x, n, 0, 3, "0", d); + END ConvertL; + + PROCEDURE ConvertH*(x: REAL; VAR d: ARRAY OF CHAR); + BEGIN + CPStrings.IntToStringForm(SYSTEM.VAL(LONGINT, x), CPStrings.hexadecimal, 0, "0", FALSE, d); + END ConvertH; + + PROCEDURE ConvertHL*(x: LONGREAL; VAR d: ARRAY OF CHAR); + BEGIN + CPStrings.IntToStringForm(SYSTEM.VAL(HUGEINT, x), CPStrings.hexadecimal, 0, "0", FALSE, d); + END ConvertHL; + +END Reals.