From d85b2fa63f595d8841dfec7a154ffe4d0b3c99ee Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Wed, 9 Dec 2020 20:02:55 +0300 Subject: [PATCH] fix #2362 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 +-- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/School.pas | 39 ++++++++++++++++++---- bin/Lib/School.pas | 39 ++++++++++++++++++---- 6 files changed, 69 insertions(+), 19 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 933afada3..2988f5ba8 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "7"; public const string Build = "1"; - public const string Revision = "2766"; + public const string Revision = "2767"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index cc0355db1..961119af3 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=1 -%REVISION%=2766 %MINOR%=7 +%REVISION%=2767 +%COREVERSION%=1 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index df53a7c94..6b829ae12 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.7.1.2766 +3.7.1.2767 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 7e80c67dc..0d87d0037 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.7.1.2766' +!define VERSION '3.7.1.2767' diff --git a/TestSuite/CompilationSamples/School.pas b/TestSuite/CompilationSamples/School.pas index 28ab17d8c..081bdaba4 100644 --- a/TestSuite/CompilationSamples/School.pas +++ b/TestSuite/CompilationSamples/School.pas @@ -38,6 +38,9 @@ function MinMax(s: sequence of int64): (int64, int64); /// Возвращает кортеж из минимума и максимума последовательности s function MinMax(s: sequence of integer): (integer, integer); +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of real): (real, real); + /// Возвращает НОД function НОД(a, b: int64): int64; @@ -276,10 +279,12 @@ function MinMax(s: sequence of int64): (int64, int64); begin var (min, max) := (int64.MaxValue, int64.MinValue); foreach var m in s do + begin if m < min then - min := m - else if m > max then - max := m; + min := m; + if m > max then + max := m + end; Result := (min, max) end; @@ -288,10 +293,26 @@ function MinMax(s: sequence of integer): (integer, integer); begin var (min, max) := (integer.MaxValue, integer.MinValue); foreach var m in s do + begin if m < min then - min := m - else if m > max then - max := m; + min := m; + if m > max then + max := m + end; + Result := (min, max) +end; + +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of real): (real, real); +begin + var (min, max) := (real.MaxValue, -real.MaxValue); + foreach var m in s do + begin + if m < min then + min := m; + if m > max then + max := m + end; Result := (min, max) end; @@ -302,7 +323,11 @@ MinMax(Self); /// Возвращает кортеж из минимума и максимума последовательности function MinMax(Self: sequence of integer): (integer, integer); extensionmethod := -MinMax(Self); +MinMax(Self); + +/// Возвращает кортеж из минимума и максимума последовательности +function MinMax(Self: sequence of real): (real, real); extensionmethod := +MinMax(Self); {$endregion} diff --git a/bin/Lib/School.pas b/bin/Lib/School.pas index 28ab17d8c..081bdaba4 100644 --- a/bin/Lib/School.pas +++ b/bin/Lib/School.pas @@ -38,6 +38,9 @@ function MinMax(s: sequence of int64): (int64, int64); /// Возвращает кортеж из минимума и максимума последовательности s function MinMax(s: sequence of integer): (integer, integer); +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of real): (real, real); + /// Возвращает НОД function НОД(a, b: int64): int64; @@ -276,10 +279,12 @@ function MinMax(s: sequence of int64): (int64, int64); begin var (min, max) := (int64.MaxValue, int64.MinValue); foreach var m in s do + begin if m < min then - min := m - else if m > max then - max := m; + min := m; + if m > max then + max := m + end; Result := (min, max) end; @@ -288,10 +293,26 @@ function MinMax(s: sequence of integer): (integer, integer); begin var (min, max) := (integer.MaxValue, integer.MinValue); foreach var m in s do + begin if m < min then - min := m - else if m > max then - max := m; + min := m; + if m > max then + max := m + end; + Result := (min, max) +end; + +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of real): (real, real); +begin + var (min, max) := (real.MaxValue, -real.MaxValue); + foreach var m in s do + begin + if m < min then + min := m; + if m > max then + max := m + end; Result := (min, max) end; @@ -302,7 +323,11 @@ MinMax(Self); /// Возвращает кортеж из минимума и максимума последовательности function MinMax(Self: sequence of integer): (integer, integer); extensionmethod := -MinMax(Self); +MinMax(Self); + +/// Возвращает кортеж из минимума и максимума последовательности +function MinMax(Self: sequence of real): (real, real); extensionmethod := +MinMax(Self); {$endregion}