Compares x and y and returns the larger value at the top output terminal and the smaller value at the bottom output terminal. This function accepts time stamp values if all inputs are time stamp values. If the inputs are time stamp values, the function returns the later time at the top and the earlier time at the bottom. You can change the comparison mode of this function.

The connector pane displays the default data types for this polymorphic function.


icon

Inputs/Outputs

  • cdbl.png x

    xis a value to compare to y

  • cdbl.png y

    y must be of the same type as x

  • idbl.png max(x,y)

    max(x, y) is the larger value. When you compare arrays in Compare Elements mode (default), this function compares corresponding elements in each input array and returns the element with the maximum value. max(x, y) is an array consisting of the maximum value elements. When you compare arrays in Compare Aggregates mode, this function compares corresponding elements in each input array starting at the beginning of the array. When this function reaches a pair of unequal corresponding elements, max(x, y) returns the array that has the greater value for that element.

  • idbl.png min(x,y)

    min(x, y) is the smaller value. When you compare arrays in Compare Elements mode (default), this function compares corresponding elements in each input array and returns the element with the minimum value. min(x, y) is an array consisting of the minimum value elements. When you compare arrays in Compare Aggregates mode, this function compares corresponding elements in each input array starting at the beginning of the array. When this function reaches a pair of unequal corresponding elements, min(x, y) returns the array that has the smaller value for that element.

  • Behavior When Comparing NaN Elements

    In Compare Elements mode, when one or both inputs are NaN (Not-a-Number), this function produces the following results:

    • Both inputs are NaN—Both max(x,y) and min(x,y) return NaN
    • Only one input is NaN—Both max(x,y) and min(x,y) return the non-NaN value
    • Inputs are arrays—The function evaluates each pair of elements according to the previous rules

    In Compare Aggregates mode, when one or both inputs are NaN (Not-a-Number), this function produces the following results:

    • Both inputs are NaN—Both max(x,y) and min(x,y) return NaN
    • Only one input is NaN—max(x,y) returns x and min(x,y) returns y
    • Inputs are arrays—If the function encounters a NaN element in either input array, max(x,y) returns x and min(x,y) returns y

    FPGA Module Details

    The following details apply when you use this object in an FPGA VI.

    Note The following details are subject to change with each version of the LabVIEW FPGA Module.
    Single-Cycle Timed Loop Supported.
    Usage

    This function does not support Compare Aggregates mode.

    If you use this function with the single-precision floating-point data type, refer to the Using the Single-Precision Floating-Point Data Type and Deciding Which Data Type to Use in FPGA Designs topics for resource use, latency, and single-cycle Timed Loop support implications.

    Timing

    Inside single-cycle Timed Loop--When you use Comparison functions inside a single-cycle Timed Loop, the combinatorial logic delay is proportional to the width of the data types you compare.

    Outside single-cycle Timed Loop--When you use Comparison functions outside a single-cycle Timed Loop, each Comparison function takes one clock cycle.

    Resources The Comparison functions use FPGA resources in proportion to the width of the data types you compare.