IntEQ
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)) { /* ... */ }Returns
true when both values are equal.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1232:
Int next = IntInit();
if (IntEQ(&mid, &one) || IntIsZero(&mid)) {
IntDeinit(&high);
high = IntInit();- In
Int.c:1616:
}
if (IntEQ(&r, &one)) {
Int positive = IntInit();
Int mag_mod = IntInit();- In
Int.c:1834:
IntPowMod(&x, &base, &d, value);
if ((MISRA_PRIV_IntCompareU64(&x, 1) == 0) || IntEQ(&x, &n_minus_one)) {
IntDeinit(&base);
IntDeinit(&x);- In
Int.c:1850:
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.Compare.c:39:
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:65:
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);
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.Type.c:43:
Int clone = IntClone(&original);
bool result = IntEQ(&clone, &original);
result = result && (IntToU64(&clone) == 11);- In
Int.Type.c:48:
IntShiftLeft(&original, 1);
result = result && !IntEQ(&clone, &original);
result = result && (IntToU64(&clone) == 11);
result = result && (IntToU64(&original) == 22);
Last updated on