File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 157
157
//!
158
158
//! * `+` - This is intended for numeric types and indicates that the sign
159
159
//! should always be printed. Positive signs are never printed by
160
- //! default, and the negative sign is only printed by default for the
161
- //! `Signed` trait. This flag indicates that the correct sign (`+` or `-`)
162
- //! should always be printed.
160
+ //! default, and the negative sign is only printed by default for signed values.
161
+ //! This flag indicates that the correct sign (`+` or `-`) should always be printed.
163
162
//! * `-` - Currently not used
164
163
//! * `#` - This flag indicates that the "alternate" form of printing should
165
164
//! be used. The alternate forms are:
Original file line number Diff line number Diff line change @@ -805,10 +805,12 @@ mod prim_tuple {}
805
805
/// often discard insignificant digits: `println!("{}", 1.0f32 / 5.0f32)` will
806
806
/// print `0.2`.
807
807
///
808
- /// Additionally, `f32` can represent a couple of special values:
808
+ /// Additionally, `f32` can represent some special values:
809
809
///
810
- /// - `-0`: this is just due to how floats are encoded. It is semantically
811
- /// equivalent to `0` and `-0.0 == 0.0` results in `true`.
810
+ /// - `-0`: this value exists due to how floats are encoded. -0 == 0 is true, but for other
811
+ /// operations they are not equal and the difference can be useful to certain algorithms.
812
+ /// For example, operations on negative numbers that underflow to 0 will usually generate -0
813
+ /// instead of +0.
812
814
/// - [∞](#associatedconstant.INFINITY) and
813
815
/// [−∞](#associatedconstant.NEG_INFINITY): these result from calculations
814
816
/// like `1.0 / 0.0`.
You can’t perform that action at this time.
0 commit comments