diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 28a0a781f..58c2853a2 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 = "10"; public const string Build = "3"; - public const string Revision = "3635"; + public const string Revision = "3637"; 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 412156e61..32b335848 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=10 -%REVISION%=3635 +%REVISION%=3637 %COREVERSION%=3 %MAJOR%=3 diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for integer.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for integer.html index 42aac173d..966c779c7 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for integer.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for integer.html @@ -1,6 +1,8 @@ + + @@ -18,8 +20,12 @@

integer

- + + + - + + +
function Between(Self: integer; a, b: integer): boolean;
         True
function Clamp(Self: integer; min,max: integer): integer; -
         , min max
function Clamp(Self: integer; bottom,top: integer): integer; +
         , bottom top
function ClampBottom(Self: integer; bottom: integer): integer; +
         , bottom
function ClampTop(Self: integer; top: integer): integer; +
         , top
function Divs(Self,d: integer): boolean;
         True
function DivsAll(Self: integer; params a: array of integer): boolean; diff --git a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for real.html b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for real.html index ee40aee2e..4214d9fb7 100644 --- a/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for real.html +++ b/PABCNetHelp/LangGuide/PABCSystemUnit/Files/Extension methods for real.html @@ -2,6 +2,8 @@ + + @@ -17,8 +19,12 @@
         True [a,b]
function Ceil(Self: real): integer;
         ,
function Clamp(Self: real; min,max: real): real; -
         , min max
function Clamp(Self: real; bottom,top: real): real; +
         , bottom top
function ClampBottom(Self: real; bottom: real): integer; +
         , bottom
function ClampTop(Self: real; top: real): integer; +
         , top
function Floor(Self: real): integer;
         ,
function InRange(Self: real; a,b: real): boolean; diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 1c249d77e..637649a87 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.10.3.3635 +3.10.3.3637 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 3c504dc37..fe4705ca7 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.10.3.3635' +!define VERSION '3.10.3.3637' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index f0213cba7..b14736921 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -14279,18 +14279,24 @@ begin Result := Range(0, Self - 1); end; -/// Возвращает число, ограниченное диапазоном от min до max включительно -function Clamp(Self: integer; min,max: integer): integer; extensionmethod; +/// Возвращает число, ограниченное диапазоном от bottom до top включительно +function Clamp(Self: integer; bottom,top: integer): integer; extensionmethod; begin - if min > max then + if bottom > top then raise new System.ArgumentException(GetTranslation(MIN_CANNOT_BE_GREATER_THAN_MAX)); - if Self < min then - Result := min - else if Self > max then - Result := max + if Self < bottom then + Result := bottom + else if Self > top then + Result := top else Result := Self; end; +/// Возвращает число, ограниченное величиной top сверху +function ClampTop(Self: integer; top: integer): integer; extensionmethod := Min(Self, top); + +/// Возвращает число, ограниченное величиной bottom снизу +function ClampBottom(Self: integer; bottom: integer): integer; extensionmethod := Max(Self, bottom); + // ----------------------------------------------------- //>> Методы расширения типа BigInteger # Extension methods for BigInteger // ----------------------------------------------------- @@ -14382,18 +14388,25 @@ begin Result := Format('{0:f' + frac + '}', Self) end; -/// Возвращает число, ограниченное диапазоном от min до max включительно -function Clamp(Self: real; min,max: real): real; extensionmethod; +/// Возвращает число, ограниченное диапазоном от bottom до top включительно +function Clamp(Self: real; bottom,top: real): real; extensionmethod; begin - if min > max then + if bottom > top then raise new System.ArgumentException(GetTranslation(MIN_CANNOT_BE_GREATER_THAN_MAX)); - if Self < min then - Result := min - else if Self > max then - Result := max + if Self < bottom then + Result := bottom + else if Self > top then + Result := top else Result := Self; end; +/// Возвращает число, ограниченное величиной top сверху +function ClampTop(Self: real; top: real): real; extensionmethod := Min(Self, top); + +/// Возвращает число, ограниченное величиной bottom снизу +function ClampBottom(Self: real; bottom: real): real; extensionmethod := Max(Self, bottom); + + //------------------------------------------------------------------------------ //>> Методы расширения типа char # Extension methods for char //------------------------------------------------------------------------------ diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index f0213cba7..b14736921 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -14279,18 +14279,24 @@ begin Result := Range(0, Self - 1); end; -/// Возвращает число, ограниченное диапазоном от min до max включительно -function Clamp(Self: integer; min,max: integer): integer; extensionmethod; +/// Возвращает число, ограниченное диапазоном от bottom до top включительно +function Clamp(Self: integer; bottom,top: integer): integer; extensionmethod; begin - if min > max then + if bottom > top then raise new System.ArgumentException(GetTranslation(MIN_CANNOT_BE_GREATER_THAN_MAX)); - if Self < min then - Result := min - else if Self > max then - Result := max + if Self < bottom then + Result := bottom + else if Self > top then + Result := top else Result := Self; end; +/// Возвращает число, ограниченное величиной top сверху +function ClampTop(Self: integer; top: integer): integer; extensionmethod := Min(Self, top); + +/// Возвращает число, ограниченное величиной bottom снизу +function ClampBottom(Self: integer; bottom: integer): integer; extensionmethod := Max(Self, bottom); + // ----------------------------------------------------- //>> Методы расширения типа BigInteger # Extension methods for BigInteger // ----------------------------------------------------- @@ -14382,18 +14388,25 @@ begin Result := Format('{0:f' + frac + '}', Self) end; -/// Возвращает число, ограниченное диапазоном от min до max включительно -function Clamp(Self: real; min,max: real): real; extensionmethod; +/// Возвращает число, ограниченное диапазоном от bottom до top включительно +function Clamp(Self: real; bottom,top: real): real; extensionmethod; begin - if min > max then + if bottom > top then raise new System.ArgumentException(GetTranslation(MIN_CANNOT_BE_GREATER_THAN_MAX)); - if Self < min then - Result := min - else if Self > max then - Result := max + if Self < bottom then + Result := bottom + else if Self > top then + Result := top else Result := Self; end; +/// Возвращает число, ограниченное величиной top сверху +function ClampTop(Self: real; top: real): real; extensionmethod := Min(Self, top); + +/// Возвращает число, ограниченное величиной bottom снизу +function ClampBottom(Self: real; bottom: real): real; extensionmethod := Max(Self, bottom); + + //------------------------------------------------------------------------------ //>> Методы расширения типа char # Extension methods for char //------------------------------------------------------------------------------ diff --git a/bin/PascalABCNET.chm b/bin/PascalABCNET.chm index 76aebeb34..619eed3a9 100644 Binary files a/bin/PascalABCNET.chm and b/bin/PascalABCNET.chm differ