File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -982,6 +982,19 @@ mod prim_tuple {}
982982/// it is considered infectious as almost all calculations where one of the
983983/// operands is NaN will also result in NaN.
984984///
985+ /// When the number resulting from a primitive operation (addition,
986+ /// subtraction, multiplication, or division) on this type is not exactly
987+ /// representable as `f32`, it is rounded according to the roundTiesToEven
988+ /// direction defined in IEEE 754-2008. That means:
989+ ///
990+ /// - The result is the representable value closest to the true value, if there
991+ /// is a unique closest representable value.
992+ /// - If the true value is exactly half-way between two representable values,
993+ /// the result is the one with an even least-significant binary digit.
994+ /// - If the true value's magnitude is ≥ `f32::MAX` + 2<sup>(`f32::MAX_EXP` −
995+ /// `f32::MANTISSA_DIGITS` − 1)</sup>, the result is ∞ or −∞ (preserving the
996+ /// true value's sign).
997+ ///
985998/// For more information on floating point numbers, see [Wikipedia][wikipedia].
986999///
9871000/// *[See also the `std::f32::consts` module](crate::f32::consts).*
Original file line number Diff line number Diff line change @@ -982,6 +982,19 @@ mod prim_tuple {}
982982/// it is considered infectious as almost all calculations where one of the
983983/// operands is NaN will also result in NaN.
984984///
985+ /// When the number resulting from a primitive operation (addition,
986+ /// subtraction, multiplication, or division) on this type is not exactly
987+ /// representable as `f32`, it is rounded according to the roundTiesToEven
988+ /// direction defined in IEEE 754-2008. That means:
989+ ///
990+ /// - The result is the representable value closest to the true value, if there
991+ /// is a unique closest representable value.
992+ /// - If the true value is exactly half-way between two representable values,
993+ /// the result is the one with an even least-significant binary digit.
994+ /// - If the true value's magnitude is ≥ `f32::MAX` + 2<sup>(`f32::MAX_EXP` −
995+ /// `f32::MANTISSA_DIGITS` − 1)</sup>, the result is ∞ or −∞ (preserving the
996+ /// true value's sign).
997+ ///
985998/// For more information on floating point numbers, see [Wikipedia][wikipedia].
986999///
9871000/// *[See also the `std::f32::consts` module](crate::f32::consts).*
You can’t perform that action at this time.
0 commit comments