* MaxIntValue implementation from Roman Kassebaum, fixes issue #39248

This commit is contained in:
Michaël Van Canneyt 2022-11-28 09:05:22 +01:00
parent 6d814279ae
commit b056e9c2b3

View File

@ -142,6 +142,8 @@ function PopNStdDev(const data : array of Double) : double;
function PopNVariance(const data : array of Double) : double;
procedure MomentSkewKurtosis(const data : array of Double; out m1,m2,m3,m4,skew,kurtosis : double);
function MaxIntValue(const AData: array of Integer): Integer;
// Financial functions
Type
@ -883,5 +885,17 @@ begin
result:=LessThanValue;
end;
function MaxIntValue(const AData: array of Integer): Integer;
var
lCount: Integer;
begin
Result := AData[Low(AData)];
for lCount := Low(AData) + 1 to High(AData) do
begin
if Result < AData[lCount] then
Result := AData[lCount];
end;
end;
end.