Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Max(const X: TCplx; const Y: TCplx): TCplx; | Maximum of two numbers. |
| 2 | function Max(const X: TSCplx; const Y: TSCplx): TSCplx; | |
| 3 | function Max(X: Double; Y: Double): Double; | Maximum of two real numbers X and Y. |
| 4 | function Max(X: Double; Y: Integer): Double; | |
| 5 | function Max(X: Integer; Y: Double): Double; | Mixed integer/double Max/Min. |
| 6 | function Max(X: Integer; Y: Integer): Integer; | Maximum of two integer numbers X and Y. |
| 7 | function Max(X: Integer; Y: Int64): Int64; | |
| 8 | function Max(X: Int64; Y: Integer): Int64; | Mixed 64/32-bit integer Max/Min. |
| 9 | function Max(X: Int64; Y: Int64): Int64; | Maximum of two 64bit integer numbers X and Y. |
| 10 | function Max(const X: Single; const Y: Single): Single; | |
| 11 | function Maxf(X: Single; Y: Single): Single; |
Overload 1: function Max(const X: TCplx; const Y: TCplx): TCplx;
Maximum of two numbers.
Returns: TCplx (complex) - the maximum of two complex numbers X and Y.
Complex numbers are first compared by the absolute value. If they are equal they are further compared by the unwrapped phase -PI,PI angle.
Overload 2: function Max(const X: TSCplx; const Y: TSCplx): TSCplx;
Overload 3: function Max(X: Double; Y: Double): Double;
Maximum of two real numbers X and Y.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Double | scalar |
| 2 | Y | Double | scalar |
Returns: Double - the maximum of two real numbers X and Y.
Overload 4: function Max(X: Double; Y: Integer): Double;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Double | scalar |
| 2 | Y | Integer |
Returns: Double
Overload 5: function Max(X: Integer; Y: Double): Double;
Mixed integer/double Max/Min.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Integer | |
| 2 | Y | Double | scalar |
Returns: Double
Delphi promotes the Integer arg to double, but the emitted C++ sees Max(int, double) as AMBIGUOUS between the Integer and double overloads (neither is an exact match). These exact mixed overloads resolve it; in Delphi and C# an exact match wins over the promotion, so no existing call changes.
Overload 6: function Max(X: Integer; Y: Integer): Integer;
Maximum of two integer numbers X and Y.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Integer | |
| 2 | Y | Integer |
Returns: Int32 - the maximum of two integer numbers X and Y.
Uses MtxVecInt;
procedure Example;
var a: TVecInt;
max, ind: integer;
begin
CreateIt(a);
try
a.SetIt([1,2,3,4]);
max := a.Max(ind); // max=4, ind = 3
finally
FreeIt(a);
end
end;
Overload 7: function Max(X: Integer; Y: Int64): Int64;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Integer | |
| 2 | Y | Int64 |
Returns: Int64
Overload 8: function Max(X: Int64; Y: Integer): Int64;
Mixed 64/32-bit integer Max/Min.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Int64 | |
| 2 | Y | Integer |
Returns: Int64
Delphi auto-promotes the 32-bit arg to Int64, but the emitted C++ would see Max(long long, int) as AMBIGUOUS between the int and Int64 overloads. These exact overloads resolve it; in Delphi and C# an exact match wins over the promotion, so no existing call changes.
Overload 9: function Max(X: Int64; Y: Int64): Int64;
Maximum of two 64bit integer numbers X and Y.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Int64 | |
| 2 | Y | Int64 |
Returns: Int64 - the maximum of two 64bit integer numbers X and Y.
Overload 10: function Max(const X: Single; const Y: Single): Single;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Single | |
| 2 | Y | Single |
Returns: Single
Overload 11: function Maxf(X: Single; Y: Single): Single;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | Single | scalar |
| 2 | Y | Single | scalar |
Returns: Single