本文简要介绍rust语言中 u128.unstable_div_floor
的用法。
用法
pub const fn unstable_div_floor(self, rhs: u128) -> u128
计算 self
和 rhs
的商,将结果四舍五入到负无穷大。
这与对所有无符号整数执行 self / rhs
相同。
Panics
如果rhs
为 0,此函数将出现紧急情况。
例子
基本用法:
#![feature(int_roundings)]
assert_eq!(7_u128.unstable_div_floor(4), 1);
相关用法
- Rust u128.unstable_div_ceil用法及代码示例
- Rust u128.unstable_next_multiple_of用法及代码示例
- 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_div_floor。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。