Function Math Reals Class

Max3Real

" Maximum Of Three Real Numbers" Return the maximum of three numeric arguments. Returns the leftmost of the maximum arguments.

Signature (Visual Basic / VBA)

Public Function Max3Real( _
      ByVal vNum1 As Variant _
    , ByVal vNum2 As Variant _
    , ByVal vNum3 As Variant _
    ) As Variant

Code Example

    Max3Real(23, 45, 56) = 56
    Max3Real(-12, 12, 4) = 12
    Max3Real(2%, 2#, 2!) = 2%
    Max3Real("SA", "RO", "EN") = "SA"

Parameters

Parameter Description
vNum1 First of three numeric arguments, the maximum of which will be returned.
vNum2 Second of three numeric arguments, the maximum of which will be returned.
vNum3 Third of three numeric arguments, the maximum of which will be returned.

Notes & Version History

Note If all three arguments happen to be strings, they will be compared using Binary comparisons.
Note This function will generate an error if any of the arguments are not compatible, such as if one is a string and the other is numeric; see also the Max3Variant function.
Note This function does not support three-valued logic. The behavior of this function is undefined if any of the arguments are Null.