IntTryLog2
Description
Try to compute floor(log2(value)).
Success
Returns true. The result has been computed and the destination object updated.
Failure
Returns false when value is zero. The destination is left untouched.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:374:
}
bool IntTryLog2(const Int *value, u64 *out) {
if (!value || !out) {
LOG_FATAL("Invalid arguments");- In
Int.c:392:
u64 IntLog2WithError(const Int *value, bool *error) {
u64 out = 0;
bool ok = IntTryLog2(value, &out);
if (error) {- In
Int.c:1918:
u64 max_degree = 0;
if (!IntTryLog2(value, &max_degree)) {
return false;
}
Last updated on