IntIsOdd
Description
Test whether the integer’s value is odd.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to inspect. |
Success
Returns true when the integer is odd.
Failure
Returns false when the integer is even (including zero).
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:451:
}
bool IntIsOdd(const Int *value) {
return int_is_odd(value);
}- In
Float.c:268:
// 10 implies even), so the strip loop below would do nothing - skip it and
// its divisor/quotient allocations entirely.
if (IntIsOdd(&value->significand)) {
return;
}- In
Math.c:2608:
// Real code returns false cleanly; the mutant crashes -> distinguishable.
bool test_m27_is_odd_zero_no_abort(void) {
WriteFmt("Testing IntIsOdd(0) returns false without aborting\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Math.c:2614:
Int zero = IntInit(&alloc.base);
bool result = (IntIsOdd(&zero) == false);
IntDeinit(&zero);- In
Access.c:98:
bool result = IntIsEven(&even);
result = result && !IntIsOdd(&even);
result = result && IntIsOdd(&odd);
result = result && !IntIsEven(&odd);- In
Access.c:99:
bool result = IntIsEven(&even);
result = result && !IntIsOdd(&even);
result = result && IntIsOdd(&odd);
result = result && !IntIsEven(&odd);
Last updated on