mirror of
https://github.com/mfontanini/libtins
synced 2026-01-22 18:25:57 +01:00
Avoid float precision problems of logarithm.
This commit is contained in:
@@ -45,7 +45,7 @@ uint32_t calculate_padding(uint32_t alignment, uint32_t offset) {
|
||||
}
|
||||
|
||||
uint32_t get_bit(uint32_t value) {
|
||||
return log(value) / log(2);
|
||||
return round(log2(value));
|
||||
}
|
||||
|
||||
RadioTapWriter::RadioTapWriter(vector<uint8_t>& buffer)
|
||||
|
||||
Reference in New Issue
Block a user