Clarify rational behind current implementation of .mod_euc()

This commit is contained in:
Fabian Kössel 2018-05-28 12:40:16 +02:00
parent af6f0f2e10
commit daeadc6c2e
2 changed files with 8 additions and 0 deletions

View file

@ -258,6 +258,10 @@ impl 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
///

View file

@ -234,6 +234,10 @@ impl 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
///