Add ilog10 result range hints
This commit is contained in:
parent
cc3eee7fbe
commit
4046385d60
4 changed files with 282 additions and 50 deletions
|
|
@ -3527,11 +3527,7 @@ macro_rules! int_impl {
|
|||
without modifying the original"]
|
||||
#[inline]
|
||||
pub const fn checked_ilog10(self) -> Option<u32> {
|
||||
if self > 0 {
|
||||
Some(int_log10::$ActualT(self as $ActualT))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
int_log10::$ActualT(self as $ActualT)
|
||||
}
|
||||
|
||||
/// Computes the absolute value of `self`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue