}
}
- /// Wrapping (modular) division. Computes `floor(self / other)`,
+ /// Wrapping (modular) division. Computes `self / other`,
/// wrapping around at the boundary of the type.
///
/// The only case where such wrapping can occur is when one
/// negative minimal value for the type); this is equivalent
/// to `-MIN`, a positive value that is too large to represent
/// in the type. In such a case, this function returns `MIN`
- /// itself..
+ /// itself.
#[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)]
pub fn wrapping_div(self, rhs: Self) -> Self {
}
}
- /// Wrapping (modular) division. Computes `floor(self / other)`,
+ /// Wrapping (modular) division. Computes `self / other`,
/// wrapping around at the boundary of the type.
///
/// The only case where such wrapping can occur is when one
/// negative minimal value for the type); this is equivalent
/// to `-MIN`, a positive value that is too large to represent
/// in the type. In such a case, this function returns `MIN`
- /// itself..
+ /// itself.
#[stable(feature = "num_wrapping", since = "1.2.0")]
#[inline(always)]
pub fn wrapping_div(self, rhs: Self) -> Self {
/// The `Div` trait is used to specify the functionality of `/`.
///
+/// For primitive integral types, this operation rounds towards zero,
+/// truncating any fractional part of the exact result.
+///
/// # Examples
///
/// A trivial implementation of `Div`. When `Foo / Foo` happens, it ends up
/// The `Rem` trait is used to specify the functionality of `%`.
///
+/// For primitive integral types, this operation satisfies `n % d == n
+/// - (n / d) * d`. The result has the same sign as the left operand.
+///
/// # Examples
///
/// A trivial implementation of `Rem`. When `Foo % Foo` happens, it ends up