mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
More WIP, getting closer.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user