Tor
0.4.7.0-alpha-dev
|
Count the bits in an integer, manipulate powers of 2, etc. More...
#include "lib/intmath/bits.h"
Go to the source code of this file.
Functions | |
int | tor_log2 (uint64_t u64) |
uint64_t | round_to_power_of_2 (uint64_t u64) |
int | n_bits_set_u8 (uint8_t v) |
Count the bits in an integer, manipulate powers of 2, etc.
Definition in file bits.c.
int n_bits_set_u8 | ( | uint8_t | v | ) |
uint64_t round_to_power_of_2 | ( | uint64_t | u64 | ) |
int tor_log2 | ( | uint64_t | u64 | ) |
Returns floor(log2(u64)). If u64 is 0, (incorrectly) returns 0.
Definition at line 16 of file bits.c.
Referenced by domain_to_string(), and round_to_power_of_2().