Common/MathUtil: Move IntLog2 into MathUtil namespace

Gets this out of the global namespace.
This commit is contained in:
Lioncash
2023-04-15 03:27:35 -04:00
parent 5e0c20f8a5
commit 784a216927
14 changed files with 36 additions and 36 deletions

View File

@ -547,7 +547,7 @@ std::string FormatSize(u64 bytes, int decimals)
// div 10 to get largest named unit less than size
// 10 == log2(1024) (number of B in a KiB, KiB in a MiB, etc)
// Max value is 63 / 10 = 6
const int unit = IntLog2(std::max<u64>(bytes, 1)) / 10;
const int unit = MathUtil::IntLog2(std::max<u64>(bytes, 1)) / 10;
// Don't need exact values, only 5 most significant digits
const double unit_size = std::pow(2, unit * 10);