summaryrefslogblamecommitdiff
path: root/zap/source/any/str/numdig.hh
blob: 65756b9bc0d3272646312f1ed9b16033abc49aea (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                                                                                     
#pragma once

namespace zap {
	namespace impl {
		template<typename typ> zap_priv_inln inline static auto numdig(typ fmtval,::zap::i8 const bs) noexcept -> ::zap::i8 {
			::zap::i8 len = 0x0u;
			if (fmtval == typ {0x0}) return 0x1u;
			for (typ val = fmtval;val > 0x0;val /= static_cast<typ>(bs)) ++len;
			return len;
		}
	}
}