Fix atan2 inaccuracy in documentation

This commit is contained in:
DimitriiTrater 2025-09-11 19:17:05 +02:00
parent 76c5ed2847
commit d834935b57
4 changed files with 24 additions and 16 deletions

View File

@ -557,10 +557,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` | `y` | Piecewise Definition | Range |
/// |---------|---------|----------------------|---------------|
/// | `>= +0` | `>= +0` | `arctan(y/x)` | `[+0, +pi/2]` |
/// | `>= +0` | `<= -0` | `arctan(y/x)` | `[-pi/2, -0]` |
/// | `<= -0` | `>= +0` | `arctan(y/x) + pi` | `[+pi/2, +pi]`|
/// | `<= -0` | `<= -0` | `arctan(y/x) - pi` | `[-pi, -pi/2]`|
///
/// # Unspecified precision
///

View File

@ -522,10 +522,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` | `y` | Piecewise Definition | Range |
/// |---------|---------|----------------------|---------------|
/// | `>= +0` | `>= +0` | `arctan(y/x)` | `[+0, +pi/2]` |
/// | `>= +0` | `<= -0` | `arctan(y/x)` | `[-pi/2, -0]` |
/// | `<= -0` | `>= +0` | `arctan(y/x) + pi` | `[+pi/2, +pi]`|
/// | `<= -0` | `<= -0` | `arctan(y/x) - pi` | `[-pi, -pi/2]`|
///
/// # Unspecified precision
///

View File

@ -826,10 +826,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` | `y` | Piecewise Definition | Range |
/// |---------|---------|----------------------|---------------|
/// | `>= +0` | `>= +0` | `arctan(y/x)` | `[+0, +pi/2]` |
/// | `>= +0` | `<= -0` | `arctan(y/x)` | `[-pi/2, -0]` |
/// | `<= -0` | `>= +0` | `arctan(y/x) + pi` | `[+pi/2, +pi]`|
/// | `<= -0` | `<= -0` | `arctan(y/x) - pi` | `[-pi, -pi/2]`|
///
/// # Unspecified precision
///

View File

@ -826,10 +826,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` | `y` | Piecewise Definition | Range |
/// |---------|---------|----------------------|---------------|
/// | `>= +0` | `>= +0` | `arctan(y/x)` | `[+0, +pi/2]` |
/// | `>= +0` | `<= -0` | `arctan(y/x)` | `[-pi/2, -0]` |
/// | `<= -0` | `>= +0` | `arctan(y/x) + pi` | `[+pi/2, +pi]`|
/// | `<= -0` | `<= -0` | `arctan(y/x) - pi` | `[-pi, -pi/2]`|
///
/// # Unspecified precision
///