IntEQ
Description
Test whether two numeric values compare equal. The right-hand operand may be an Int, Int*, const Int*, u64, or i64 compatible type.
Parameters
| Name | Direction | Description |
|---|---|---|
lhs |
in | Left-hand integer |
rhs |
in | Right-hand operand selected through generic dispatch |
Usage example (from documentation)
if (IntEQ(&value, 10u)) { /* ... */ }Success
Returns true when both values are equal.
Failure
Returns false otherwise.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1818:
Int next = IntInit(IntAllocator(root));
if (IntEQ(&mid, &one) || IntIsZero(&mid)) {
IntDeinit(&high);
high = IntInit(IntAllocator(root));- In
Int.c:2373:
}
if (IntEQ(&r, &one)) {
Int positive = IntInit(IntAllocator(result));
Int mag_mod = IntInit(IntAllocator(result));- In
Int.c:2819:
return false;
}
if ((int_compare_u64(&x, 1) == 0) || IntEQ(&x, &n_minus_one)) {
IntDeinit(&base);
IntDeinit(&x);- In
Int.c:2842:
x = next;
if (IntEQ(&x, &n_minus_one)) {
witness = false;
break;
bool result = IntCompare(&lhs, &rhs) == 0;
result = result && IntEQ(&lhs, &rhs);
IntDeinit(&lhs);- In
Int.Type.c:54:
Int clone = IntClone(&original);
bool result = IntEQ(&clone, &original);
result = result && (IntToU64(&clone) == 11);- In
Int.Type.c:59:
IntShiftLeft(&original, 1);
result = result && !IntEQ(&clone, &original);
result = result && (IntToU64(&clone) == 11);
result = result && (IntToU64(&original) == 22);
bool result = !FloatToInt(&result_value, &value);
result = result && IntEQ(&result_value, 99);
FloatDeinit(&value);
bool result = !FloatToInt(&result_value, &value);
result = result && IntEQ(&result_value, 99);
FloatDeinit(&value);- In
Int.Compare.c:49:
result = result && IntGT(&b, &a);
result = result && IntGE(&b, &a);
result = result && IntEQ(&b, &c);
result = result && IntGE(&b, &c);
result = result && IntLE(&b, &c);- In
Int.Compare.c:78:
result = result && (IntCompare(&value, -1) > 0);
result = result && (IntCompare(&big, UINT64_MAX) > 0);
result = result && IntEQ(&value, 42);
result = result && IntLE(&value, 42);
result = result && IntGT(&value, -1);
Last updated on