mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 18:40:57 +03:00
Clarify rational behind current implementation of .mod_euc()
This commit is contained in:
@@ -258,6 +258,10 @@ pub fn div_euc(self, rhs: f32) -> f32 {
|
||||
/// most cases. However, due to a floating point round-off error it can
|
||||
/// result in `r == rhs.abs()`, violating the mathematical definition, if
|
||||
/// `self` is much smaller than `rhs.abs()` in magnitude and `self < 0.0`.
|
||||
/// This result is not an element of the function's codomain, but it is the
|
||||
/// closest floating point number in the real numbers and thus fulfills the
|
||||
/// property `self == self.div_euc(rhs) * rhs + self.mod_euc(rhs)`
|
||||
/// approximatively.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
@@ -234,6 +234,10 @@ pub fn div_euc(self, rhs: f64) -> f64 {
|
||||
/// most cases. However, due to a floating point round-off error it can
|
||||
/// result in `r == rhs.abs()`, violating the mathematical definition, if
|
||||
/// `self` is much smaller than `rhs.abs()` in magnitude and `self < 0.0`.
|
||||
/// This result is not an element of the function's codomain, but it is the
|
||||
/// closest floating point number in the real numbers and thus fulfills the
|
||||
/// property `self == self.div_euc(rhs) * rhs + self.mod_euc(rhs)`
|
||||
/// approximatively.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user