IntIsEven
IntIsEven
Description
Test whether the integer is even.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to test |
Usage example (from documentation)
bool even = IntIsEven(&value);Returns
true when the least-significant bit is zero.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:323:
}
bool IntIsEven(Int *value) {
ValidateInt(value);
return !int_is_odd(value);- In
Int.c:1327:
ValidateInt(n);
if (IntIsZero(n) || IntIsEven(n)) {
LOG_FATAL("n must be non-zero and odd");
}- In
Int.c:1338:
while (!IntIsZero(&aa)) {
while (IntIsEven(&aa)) {
u64 n_mod_8 = 0;- In
Int.c:1665:
return true;
}
if (IntIsEven(modulus) || !IntIsProbablePrime(modulus)) {
IntDeinit(&a);
return false;- In
Int.c:1697:
(void)MISRA_PRIV_IntSubU64(&q, &q, 1);
while (IntIsEven(&q)) {
IntShiftRight(&q, 1);
m++;- In
Int.c:1796:
return true;
}
if (IntIsEven(value)) {
return false;
}- In
Int.c:1818:
n_minus_one = IntClone(&d);
while (IntIsEven(&d)) {
IntShiftRight(&d, 1);
s++;- In
Int.c:1893:
return;
}
if (IntIsEven(&candidate)) {
MISRA_PRIV_IntAddU64(&candidate, &candidate, 1);
}- In
Int.Access.c:74:
Int odd = IntFrom(43);
bool result = IntIsEven(&even);
result = result && !IntIsOdd(&even);
result = result && IntIsOdd(&odd);- In
Int.Access.c:77:
result = result && !IntIsOdd(&even);
result = result && IntIsOdd(&odd);
result = result && !IntIsEven(&odd);
IntDeinit(&even);
Last updated on