Add ilog10 result range hints

This commit is contained in:
EFanZh 2025-11-29 09:52:19 +08:00
parent cc3eee7fbe
commit 4046385d60
4 changed files with 282 additions and 50 deletions

View file

@ -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`.