本文簡要介紹rust語言中 u128.unstable_next_multiple_of
的用法。
用法
pub const fn unstable_next_multiple_of(self, rhs: u128) -> u128
計算大於或等於 self
的最小值,它是 rhs
的倍數。
Panics
如果rhs
為 0 或操作導致溢出,此函數將出現緊急情況。
例子
基本用法:
#![feature(int_roundings)]
assert_eq!(16_u128.unstable_next_multiple_of(8), 16);
assert_eq!(23_u128.unstable_next_multiple_of(8), 24);
相關用法
- Rust u128.unstable_div_floor用法及代碼示例
- Rust u128.unstable_div_ceil用法及代碼示例
- Rust u128.checked_pow用法及代碼示例
- Rust u128.borrowing_sub用法及代碼示例
- Rust u128.to_be用法及代碼示例
- Rust u128.checked_shl用法及代碼示例
- Rust u128.checked_shr用法及代碼示例
- Rust u128.from_be_bytes用法及代碼示例
- Rust u128.wrapping_rem_euclid用法及代碼示例
- Rust u128.carrying_add用法及代碼示例
- Rust u128.from_be用法及代碼示例
- Rust u128.rotate_left用法及代碼示例
- Rust u128.count_ones用法及代碼示例
- Rust u128.checked_rem_euclid用法及代碼示例
- Rust u128.rotate_right用法及代碼示例
- Rust u128.saturating_pow用法及代碼示例
- Rust u128.is_power_of_two用法及代碼示例
- Rust u128.saturating_add用法及代碼示例
- Rust u128.overflowing_rem_euclid用法及代碼示例
- Rust u128.from_le用法及代碼示例
- Rust u128.saturating_div用法及代碼示例
- Rust u128.overflowing_rem用法及代碼示例
- Rust u128.wrapping_div用法及代碼示例
- Rust u128.leading_zeros用法及代碼示例
- Rust u128.overflowing_pow用法及代碼示例
注:本文由純淨天空篩選整理自rust-lang.org大神的英文原創作品 u128.unstable_next_multiple_of。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。