xieite ::num_digits ()
Defined in fragment xieite :num_digits
(header-only:
<xieite/math/num_digits.hpp>
)
Computes the number of digits in a number, in any integral radix.
Declaration
%%NOTES%%template <std ::integral T > [[nodiscard ]]constexpr std ::size_t num_digits (T value ,T radix =10 )noexcept ;
Example
Output:import xieite ;int main () {xieite ::dump (xieite ::num_digits (12345 ));xieite ::dump (xieite ::num_digits (255 ,16 ));// FF xieite ::dump (xieite ::num_digits (341 ,2 ));// 101010101 }
5 2 9