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)
- In
Types.h:416:
///
/// TAGS: Math, Utility, Range
#define CLAMP(x, lo, hi) MIN2(MAX2(lo, x), hi)
///
- In
Int.c:1272:
u64 a_bits = IntBitLength(a);
u64 b_bits = IntBitLength(b);
u64 max_bits = MAX2(a_bits, b_bits);
// a + b < 2^(max_bits+1), so max_bits+1 bits always hold the sum (incl. carry).
- In
BitVec.c:601:
u64 a_bytes = BYTES_FOR_BITS(a_len);
u64 b_bytes = BYTES_FOR_BITS(b_len);
u64 out_len = MAX2(a_len, b_len);
if (!BitVecResize(result, out_len)) {- In
BitVec.c:622:
u64 a_bytes = BYTES_FOR_BITS(a_len);
u64 b_bytes = BYTES_FOR_BITS(b_len);
u64 out_len = MAX2(a_len, b_len);
if (!BitVecResize(result, out_len)) {- In
BitVec.c:765:
// differing bit decides the ordering and bits past the shorter
// operand's length read as zero.
u64 max_len = MAX2(bv1->length, bv2->length);
for (u64 i = max_len; i > 0;) {- In
BitVec.c:832:
// range positions read as 0, so positions past bv2's length where
// bv1 has a 1 disqualify the subset relation.
u64 max_len = MAX2(bv1->length, bv2->length);
for (u64 i = 0; i < max_len; i++) {- In
BitVec.c:1462:
u64 min_length = MIN2(bv1->length, bv2->length);
u64 max_length = MAX2(bv1->length, bv2->length);
u64 distance = 0;- In
BitVec.c:1490:
u64 intersection = BitVecDotProduct(bv1, bv2);
u64 max_length = MAX2(bv1->length, bv2->length);
u64 union_count = 0;- In
BitVec.c:1622:
ValidateBitVec(bv2);
u64 max_length = MAX2(bv1->length, bv2->length);
if (max_length == 0)
return 1.0;
Last updated on