More WIP, getting closer.

This commit is contained in:
Martín Lucas Golini
2024-05-15 00:46:58 -03:00
parent 8c404f0825
commit bb7df84f8c
12 changed files with 292 additions and 81 deletions

View File

@@ -91,12 +91,7 @@ template <typename T> inline T roundDown( T x ) {
/** @return The number of digits in a number. */
template <typename T> static T countDigits( T num ) {
T count = 0;
while ( num != 0 ) {
count++;
num /= 10;
}
return count;
return num == 0 ? 1 : (T)log10( std::abs( num ) ) + 1;
}
}} // namespace EE::Math