IntIsEven
Description
Test whether the integer’s value is even.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to inspect. |
Success
Returns true when the integer is even (including zero).
Failure
Returns false when the integer is odd.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:421:
}
bool IntIsEven(const Int *value) {
ValidateInt(value);
return !int_is_odd(value);- In
Int.c:1953:
}
if (IntIsZero(n) || IntIsEven(n)) {
LOG_ERROR("n must be non-zero and odd");
return false;- In
Int.c:1969:
while (!IntIsZero(&aa)) {
while (IntIsEven(&aa)) {
u64 n_mod_8 = 0;- In
Int.c:2464:
return false;
}
if (IntIsEven(modulus) || !prime) {
IntDeinit(&a);
return false;- In
Int.c:2513:
return false;
}
while (IntIsEven(&q)) {
if (!IntShiftRight(&q, 1)) {
IntDeinit(&q);- In
Int.c:2755:
return true;
}
if (IntIsEven(value)) {
return false;
}- In
Int.c:2785:
}
while (IntIsEven(&d)) {
if (!IntShiftRight(&d, 1)) {
IntDeinit(&d);- In
Int.c:2906:
return true;
}
if (IntIsEven(&candidate)) {
if (!int_add_u64(&candidate, &candidate, 1)) {
IntDeinit(&candidate);- In
Int.Access.c:89:
Int odd = IntFrom(43, &alloc.base);
bool result = IntIsEven(&even);
result = result && !IntIsOdd(&even);
result = result && IntIsOdd(&odd);- In
Int.Access.c:92:
result = result && !IntIsOdd(&even);
result = result && IntIsOdd(&odd);
result = result && !IntIsEven(&odd);
IntDeinit(&even);
Last updated on