#length #traits #numbers #digits #maths

no-std get_len_base_10_as_usize

Traits for getting length base 10 as usize, both at run and compile time

7 releases

0.1.6 Feb 4, 2022
0.1.5 Feb 3, 2022
0.1.1 Jan 16, 2022

#32 in #maths

40 downloads per month

MIT/Apache

17KB
249 lines

Traits for getting length base 10 as usize

This crate offers such traits as MaxLenBase10AsUsize, GetLenBase10AsUsizeViaRepeatedMultiplicationBy10, GetLenBase10AsUsize, GetLenBase10AsUsizeViaDivigingWithPowsOf2 GetLenBase10AsUsizeViaStringConversion, and TryEstimateLenBase10AsClosedUsizeIntvlViaFPLogarithm.

Example

use get_len_base_10_as_usize::MaxLenBase10AsUsize;

assert_eq!(u64::MAX_LEN_BASE_10_AS_USIZE, 20);

Sources of insipration

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2MB
~39K SLoC