From 18955203d374fa9a39f8dfdbcdd92fda5895e41f Mon Sep 17 00:00:00 2001 From: Trevor Spiteri Date: Fri, 16 Apr 2021 21:48:41 +0200 Subject: [PATCH 1/2] 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. --- library/std/src/primitive_docs.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 64b22b64f4bf1..e6fb6ff42fce9 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -807,10 +807,10 @@ mod prim_tuple {} /// /// Additionally, `f32` can represent some special values: /// -/// - -0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so -0.0 is a -/// possible value. For comparison `-0.0 == +0.0` is true but floating point operations can -/// carry the sign bit through arithmetic operations. This means `-1.0 * 0.0` produces -0.0 and -/// a negative number rounded to a value smaller than a float can represent also produces -0.0. +/// - −0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so −0.0 is a +/// possible value. For comparison `-0.0 == 0.0` is true but floating point operations can +/// carry the sign bit through arithmetic operations. This means `-1.0 * 0.0` produces −0.0 and +/// a negative number rounded to a value smaller than a float can represent also produces −0.0. /// - [∞](#associatedconstant.INFINITY) and /// [−∞](#associatedconstant.NEG_INFINITY): these result from calculations /// like `1.0 / 0.0`. From 4c6477026dbdb80e1deb26f0d815a462a941c4e5 Mon Sep 17 00:00:00 2001 From: Trevor Spiteri Date: Mon, 19 Apr 2021 02:58:38 +0200 Subject: [PATCH 2/2] Update library/std/src/primitive_docs.rs Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- library/std/src/primitive_docs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index e6fb6ff42fce9..84d072b9860e8 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -808,8 +808,8 @@ mod prim_tuple {} /// Additionally, `f32` can represent some special values: /// /// - −0.0: IEEE 754 floating point numbers have a bit that indicates their sign, so −0.0 is a -/// possible value. For comparison `-0.0 == 0.0` is true but floating point operations can -/// carry the sign bit through arithmetic operations. This means `-1.0 * 0.0` produces −0.0 and +/// possible value. For comparison −0.0 = +0.0, but floating point operations can carry +/// the sign bit through arithmetic operations. This means −0.0 × +0.0 produces −0.0 and /// a negative number rounded to a value smaller than a float can represent also produces −0.0. /// - [∞](#associatedconstant.INFINITY) and /// [−∞](#associatedconstant.NEG_INFINITY): these result from calculations