本文簡要介紹rust語言中 i64.log10
的用法。
用法
pub const fn log10(self) -> u32
返回數字的以 10 為底的對數,向下舍入。
Panics
當數字為零時,它會在調試模式下發生Panics,在發布模式下返回值為 0。
示例
#![feature(int_log)]
assert_eq!(10i64.log10(), 1);
相關用法
- Rust i64.log用法及代碼示例
- Rust i64.log2用法及代碼示例
- Rust i64.leading_zeros用法及代碼示例
- Rust i64.leading_ones用法及代碼示例
- Rust i64.overflowing_add_unsigned用法及代碼示例
- Rust i64.abs用法及代碼示例
- Rust i64.checked_add用法及代碼示例
- Rust i64.saturating_abs用法及代碼示例
- Rust i64.checked_abs用法及代碼示例
- Rust i64.overflowing_div_euclid用法及代碼示例
- Rust i64.checked_mul用法及代碼示例
- Rust i64.from_le_bytes用法及代碼示例
- Rust i64.signum用法及代碼示例
- Rust i64.wrapping_add用法及代碼示例
- Rust i64.from_be_bytes用法及代碼示例
- Rust i64.checked_sub用法及代碼示例
- Rust i64.checked_shr用法及代碼示例
- Rust i64.checked_shl用法及代碼示例
- Rust i64.to_ne_bytes用法及代碼示例
- Rust i64.saturating_add_unsigned用法及代碼示例
- Rust i64.wrapping_rem用法及代碼示例
- Rust i64.wrapping_add_unsigned用法及代碼示例
- Rust i64.unstable_div_ceil用法及代碼示例
- Rust i64.trailing_zeros用法及代碼示例
- Rust i64.count_zeros用法及代碼示例
注:本文由純淨天空篩選整理自rust-lang.org大神的英文原創作品 i64.log10。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。