Вернул CLampTop CLampBottom по заявкам
This commit is contained in:
parent
5bd51e4c96
commit
f719f1d145
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=10
|
||||
%REVISION%=3635
|
||||
%REVISION%=3637
|
||||
%COREVERSION%=3
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
<HTML><HEAD><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
|
||||
<param name="Keyword" value="Between">
|
||||
<param name="Keyword" value="Clamp">
|
||||
<param name="Keyword" value="ClampBottom">
|
||||
<param name="Keyword" value="ClampTop">
|
||||
<param name="Keyword" value="Divs">
|
||||
<param name="Keyword" value="DivsAll">
|
||||
<param name="Keyword" value="DivsAny">
|
||||
|
|
@ -18,8 +20,12 @@
|
|||
</HEAD><body><H1>Ìåòîäû ðàñøèðåíèÿ òèïà integer</H1>
|
||||
<table border=0 cellpadding=5><tr><td><code><b>function</b> Between(Self: integer; a, b: integer): boolean;</code>
|
||||
<br> Âîçâðàùàåò True åñëè çíà÷åíèå íàõîäèòñÿ ìåæäó äâóìÿ äðóãèìè</td></tr>
|
||||
<tr><td><code><b>function</b> Clamp(Self: integer; min,max: integer): integer;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå äèàïàçîíîì îò min äî max âêëþ÷èòåëüíî</td></tr>
|
||||
<tr><td><code><b>function</b> Clamp(Self: integer; bottom,top: integer): integer;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå äèàïàçîíîì îò bottom äî top âêëþ÷èòåëüíî</td></tr>
|
||||
<tr><td><code><b>function</b> ClampBottom(Self: integer; bottom: integer): integer;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå âåëè÷èíîé bottom ñíèçó</td></tr>
|
||||
<tr><td><code><b>function</b> ClampTop(Self: integer; top: integer): integer;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå âåëè÷èíîé top ñâåðõó</td></tr>
|
||||
<tr><td><code><b>function</b> Divs(Self,d: integer): boolean;</code>
|
||||
<br> Âîçâðàùàåò True åñëè öåëîå äåëèòñÿ íà óêàçàííîå çíà÷åíèå</td></tr>
|
||||
<tr><td><code><b>function</b> DivsAll(Self: integer; <b>params</b> a: <b>array</b> <b>of</b> integer): boolean;</code>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
<param name="Keyword" value="Between">
|
||||
<param name="Keyword" value="Ceil">
|
||||
<param name="Keyword" value="Clamp">
|
||||
<param name="Keyword" value="ClampBottom">
|
||||
<param name="Keyword" value="ClampTop">
|
||||
<param name="Keyword" value="Floor">
|
||||
<param name="Keyword" value="InRange">
|
||||
<param name="Keyword" value="Round">
|
||||
|
|
@ -17,8 +19,12 @@
|
|||
<br> Âîçâðàùàåò True åñëè çíà÷åíèå íàõîäèòñÿ â äèàïàçîíå [a,b]</td></tr>
|
||||
<tr><td><code><b>function</b> Ceil(Self: real): integer;</code>
|
||||
<br> Âîçâðàùàåò íàìåíüøåå öåëîå, áîëüøåå èëè ðàâíîå âåùåñòâåííîìó ÷èñëó</td></tr>
|
||||
<tr><td><code><b>function</b> Clamp(Self: real; min,max: real): real;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå äèàïàçîíîì îò min äî max âêëþ÷èòåëüíî</td></tr>
|
||||
<tr><td><code><b>function</b> Clamp(Self: real; bottom,top: real): real;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå äèàïàçîíîì îò bottom äî top âêëþ÷èòåëüíî</td></tr>
|
||||
<tr><td><code><b>function</b> ClampBottom(Self: real; bottom: real): integer;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå âåëè÷èíîé bottom ñíèçó</td></tr>
|
||||
<tr><td><code><b>function</b> ClampTop(Self: real; top: real): integer;</code>
|
||||
<br> Âîçâðàùàåò ÷èñëî, îãðàíè÷åííîå âåëè÷èíîé top ñâåðõó</td></tr>
|
||||
<tr><td><code><b>function</b> Floor(Self: real): integer;</code>
|
||||
<br> Âîçâðàùàåò íàèáîëüøåå öåëîå, ìåíüøåå èëè ðàâíîå âåùåñòâåííîìó ÷èñëó</td></tr>
|
||||
<tr><td><code><b>function</b> InRange(Self: real; a,b: real): boolean;</code>
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3.10.3.3635
|
||||
3.10.3.3637
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.10.3.3635'
|
||||
!define VERSION '3.10.3.3637'
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -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
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue