pub trait UncheckedLog10Floor {
// Required method
const fn unchecked_log10_floor(self) -> Self;
}
Expand description
Returns the base-10 logarithm of self
, rounded down to the nearest integer.
§Panics
Panics if self
is zero or negative.
Required Methods§
const fn unchecked_log10_floor(self) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl UncheckedLog10Floor for Dec19x19
§Tests
check! ( [Dec19x19::unchecked_log10_floor, Dec19x19::checked_log10_floor] {
(Dec19x19::MAX) => Dec19x19!(19),
(Dec19x19!(10.1)) => Dec19x19!(1),
(Dec19x19!(10.0)) => Dec19x19!(1),
(Dec19x19!(9.99)) => Dec19x19!(0),
(Dec19x19!(1.17)) => Dec19x19!(0),
(Dec19x19!(1.0)) => Dec19x19!(0),
(Dec19x19!(0.9)) => Dec19x19!(-1),
(Dec19x19!(0.11)) => Dec19x19!(-1),
(Dec19x19!(0.1)) => Dec19x19!(-1),
(Dec19x19!(0.09)) => Dec19x19!(-2),
(-Dec19x19::SMALLEST_STEP) => FAIL,
});