diff --git a/library/std/src/f128.rs b/library/std/src/f128.rs index 217528fdf1c10..20c35cc80cc12 100644 --- a/library/std/src/f128.rs +++ b/library/std/src/f128.rs @@ -898,10 +898,12 @@ impl f128 { /// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians. /// - /// * `x = 0`, `y = 0`: `0` - /// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]` - /// * `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]` - /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` + /// * `x >= +0`, `y >= +0` -> `[+0, pi/2]` + /// * `x <= -0`, `y >= +0` -> `[pi/2, pi]` + /// * `x <= -0`, `y <= -0` -> `[-pi, -pi/2]` + /// * `x >= +0`, `y <= -0` -> `[-pi/2, -0]` + /// + /// Note that positive and negative 0 are distinct floating point values. /// /// # Unspecified precision /// diff --git a/library/std/src/f16.rs b/library/std/src/f16.rs index 4dadcbb518556..622dbc7117399 100644 --- a/library/std/src/f16.rs +++ b/library/std/src/f16.rs @@ -896,10 +896,12 @@ impl f16 { /// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians. /// - /// * `x = 0`, `y = 0`: `0` - /// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]` - /// * `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]` - /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` + /// * `x >= +0`, `y >= +0` -> `[+0, pi/2]` + /// * `x <= -0`, `y >= +0` -> `[pi/2, pi]` + /// * `x <= -0`, `y <= -0` -> `[-pi, -pi/2]` + /// * `x >= +0`, `y <= -0` -> `[-pi/2, -0]` + /// + /// Note that positive and negative 0 are distinct floating point values. /// /// # Unspecified precision /// diff --git a/library/std/src/f32.rs b/library/std/src/f32.rs index baf7002f3803c..3977b16caf307 100644 --- a/library/std/src/f32.rs +++ b/library/std/src/f32.rs @@ -824,10 +824,12 @@ impl f32 { /// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians. /// - /// * `x = 0`, `y = 0`: `0` - /// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]` - /// * `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]` - /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` + /// * `x >= +0`, `y >= +0` -> `[+0, pi/2]` + /// * `x <= -0`, `y >= +0` -> `[pi/2, pi]` + /// * `x <= -0`, `y <= -0` -> `[-pi, -pi/2]` + /// * `x >= +0`, `y <= -0` -> `[-pi/2, -0]` + /// + /// Note that positive and negative 0 are distinct floating point values. /// /// # Unspecified precision /// diff --git a/library/std/src/f64.rs b/library/std/src/f64.rs index 84fd9bfb7b680..809192f1d12e4 100644 --- a/library/std/src/f64.rs +++ b/library/std/src/f64.rs @@ -824,10 +824,12 @@ impl f64 { /// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians. /// - /// * `x = 0`, `y = 0`: `0` - /// * `x >= 0`: `arctan(y/x)` -> `[-pi/2, pi/2]` - /// * `y >= 0`: `arctan(y/x) + pi` -> `(pi/2, pi]` - /// * `y < 0`: `arctan(y/x) - pi` -> `(-pi, -pi/2)` + /// * `x >= +0`, `y >= +0` -> `[+0, pi/2]` + /// * `x <= -0`, `y >= +0` -> `[pi/2, pi]` + /// * `x <= -0`, `y <= -0` -> `[-pi, -pi/2]` + /// * `x >= +0`, `y <= -0` -> `[-pi/2, -0]` + /// + /// Note that positive and negative 0 are distinct floating point values. /// /// # Unspecified precision ///