IntTryToU64
Description
Try to convert an integer to u64.
Parameters
| Name | Direction | Description |
|---|---|---|
value |
in | Integer to convert |
out |
out | Destination for the converted value |
Success
Returns true. The result has been computed and the destination object updated.
Failure
Returns false when the value does not fit in 64 bits. The destination is left untouched.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:484:
}
bool IntTryToU64(const Int *value, u64 *out) {
if (!value || !out) {
LOG_FATAL("Invalid arguments");- In
Int.c:502:
u64 IntToU64WithError(const Int *value, bool *error) {
u64 out = 0;
bool ok = IntTryToU64(value, &out);
if (error) {- In
Int.c:981:
u64 lhs_value = 0;
(void)IntTryToU64(lhs, &lhs_value);
if (lhs_value < rhs) { IntShiftLeft(&value, 64);
bool result = !IntTryToU64(&value, &out);
result = result && (IntToU64(&value, &error) == 0);
result = result && error;
Last updated on