IntFitsU64
Description
Test whether the integer’s magnitude fits in a 64-bit unsigned value.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to inspect. |
Success
Returns true when value <= UINT64_MAX.
Failure
Returns false when the value exceeds 64 bits.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:455:
}
bool IntFitsU64(const Int *value) {
ValidateInt(value);
return IntBitLength(value) <= 64;- In
Int.c:516:
ValidateInt(value);
if (!IntFitsU64(value)) {
LOG_ERROR("Int value exceeds u64 range");
return false;- In
Int.c:1540:
ValidateInt(exponent);
if (!IntFitsU64(exponent)) {
LOG_ERROR("Int exponent exceeds u64 range");
return false;- In
Access.c:109:
bool test_int_fits_u64(void) {
WriteFmt("Testing IntFitsU64\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Access.c:118:
IntShiftLeft(&big, 64);
bool result = IntFitsU64(&small);
result = result && !IntFitsU64(&big);- In
Access.c:119:
bool result = IntFitsU64(&small);
result = result && !IntFitsU64(&big);
IntDeinit(&small);
Last updated on