MaxInt
Moduł: System
const MaxInt = High(Integer);
Stała zwraca największą możliwą wartość liczby typu Integer, czyli 2147483647. Przykład wykorzystania:
program Foo;
{$APPTYPE CONSOLE}
uses
Math, SysUtils;
begin
Writeln('Integer: ', MaxInt, ' -- ');
Writeln('LongInt: ', MaxLongInt, ' -- ');
Writeln('Comp: ', MaxComp, ' -- ', MinComp);
Writeln('Double: ', MaxDouble, ' -- ', MinDouble);
Writeln('Single: ', MaxSingle, ' -- ', MinSingle);
Writeln('Extended: ', MaxExtended, ' -- ', MinExtended);
Writeln('TDateTime: ', MaxDateTime, ' -- ', MinDateTime);
Readln;
end.
Niestety w module System nie zadeklarowano stałej MinInt, minimalną możliwą wartość typu Integer możemy pobrać korzystając z funkcji Low: `Low(Integer)`.
Zobacz też: