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:430:
}
bool IntFitsU64(const Int *value) {
ValidateInt(value);
return IntBitLength(value) <= 64;- In
Int.c:491:
ValidateInt(value);
if (!IntFitsU64(value)) {
LOG_ERROR("Int value exceeds u64 range");
return false;- In
Int.c:1284:
ValidateInt(exponent);
if (!IntFitsU64(exponent)) {
LOG_ERROR("Int exponent exceeds u64 range");
return false;- In
Int.Access.c:101:
bool test_int_fits_u64(void) {
WriteFmt("Testing IntFitsU64\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Int.Access.c:110:
IntShiftLeft(&big, 64);
bool result = IntFitsU64(&small);
result = result && !IntFitsU64(&big);- In
Int.Access.c:111:
bool result = IntFitsU64(&small);
result = result && !IntFitsU64(&big);
IntDeinit(&small);
Last updated on