Function Math Reals Class

Min2Real

" Minimum Of Two Real Numbers" Return the minimum of two numeric arguments. Returns argument on left if arguments are equal.

Signature (Visual Basic / VBA)

Public Function Min2Real( _
      ByVal vX As Variant _
    , ByVal vY As Variant _
    ) As Variant

Code Example

    Min2Real(23, 45) = 23
    Min2Real(-12, 4) = -1
    Min2Real(2%, 2#) = 2%
    Min2Real(2#, 2%) = 2#
    Min2Real("SA", "RO") = "RO"

Parameters

Parameter Description
vX First of two numeric arguments, the minimum of which will be returned.
vY Second of two numeric arguments, the minimum of which will be returned.

Notes & Version History

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