Skip to content

Commit fb78dc0

Browse files
authored
Rollup merge of #84256 - tspiteri:pretty-minus-zero, r=workingjubilee
doc: use U+2212 for minus sign in floating-point -0.0 remarks Also remove plus sign in `-0.0 == +0.0` to make it a valid expression.
2 parents e5b5745 + 4c64770 commit fb78dc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/std/src/primitive_docs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,10 @@ mod prim_tuple {}
807807
///
808808
/// Additionally, `f32` can represent some special values:
809809
///
810-
/// - -0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so -0.0 is a
811-
/// possible value. For comparison `-0.0 == +0.0` is true but floating point operations can
812-
/// carry the sign bit through arithmetic operations. This means `-1.0 * 0.0` produces -0.0 and
813-
/// a negative number rounded to a value smaller than a float can represent also produces -0.0.
810+
/// - 0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so 0.0 is a
811+
/// possible value. For comparison 0.0 = +0.0, but floating point operations can carry
812+
/// the sign bit through arithmetic operations. This means −0.0 × +0.0 produces 0.0 and
813+
/// a negative number rounded to a value smaller than a float can represent also produces 0.0.
814814
/// - [∞](#associatedconstant.INFINITY) and
815815
/// [−∞](#associatedconstant.NEG_INFINITY): these result from calculations
816816
/// like `1.0 / 0.0`.

0 commit comments

Comments
 (0)