1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Avoid float precision problems of logarithm.

This commit is contained in:
DDoSolitary
2019-03-10 11:45:36 +08:00
parent 74e3d909e6
commit ba2216e6e9

View File

@@ -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)