Skip to content

MAX2

MAX2

Description

Returns the larger of two values x and y.

Parameters

Name Direction Description
x in First value for comparison.
y in Second value for comparison.

Success

Returns the larger of x and y.

Failure

Function cannot fail - always returns a value.

Usage example (Cross-references)

Usage examples (Cross-references)
        u64 a_bits   = IntBitLength(a);
        u64 b_bits   = IntBitLength(b);
        u64 max_bits = MAX2(a_bits, b_bits);
        Int temp     = int_init_with_capacity(max_bits + 1);
        bool carry   = false;
        ValidateBitVec(b);
    
        u64 max_len = MAX2(a->length, b->length);
        BitVecResize(result, max_len);
        ValidateBitVec(b);
    
        u64 max_len = MAX2(a->length, b->length);
        BitVecResize(result, max_len);
        // Compare as unsigned integers (LSB first)
        // Start from the most significant bit (highest index)
        u64 max_len = MAX2(bv1->length, bv2->length);
    
        for (u64 i = max_len; i > 0;) {
    
        // bv1 is subset of bv2 if all 1-bits in bv1 are also 1-bits in bv2
        u64 max_len = MAX2(bv1->length, bv2->length);
    
        for (u64 i = 0; i < max_len; i++) {
    
        u64 min_length = MIN2(bv1->length, bv2->length);
        u64 max_length = MAX2(bv1->length, bv2->length);
        u64 distance   = 0;
    
        // Calculate union count
        u64 max_length  = MAX2(bv1->length, bv2->length);
        u64 union_count = 0;
        ValidateBitVec(bv2);
    
        u64 max_length = MAX2(bv1->length, bv2->length);
        if (max_length == 0)
            return 1.0;
    ///
    /// TAGS: Math, Utility, Range
    #define CLAMP(x, lo, hi) MIN2(MAX2(lo, x), hi)
    
    ///
Last updated on