From 16dc6e2310859459d5e08ea406d813c2b84ccd5e Mon Sep 17 00:00:00 2001 From: AzizCode92 Date: Sun, 17 Aug 2025 13:38:51 +0200 Subject: [PATCH 1/3] Docs: Clarify cmath.nan/inf by linking to math module The documentation for `cmath.nan` and `cmath.inf` is updated to cross-reference the equivalent constants in the `math` module. The `math` module's documentation contains a more thorough explanation of the properties of these special floating-point values, as required by the IEEE 754 standard (e.g., that NaN does not compare equal to itself). --- Doc/library/cmath.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/cmath.rst b/Doc/library/cmath.rst index 26518a0458fd81..0a9f5e07dd2614 100644 --- a/Doc/library/cmath.rst +++ b/Doc/library/cmath.rst @@ -322,7 +322,7 @@ Constants .. data:: inf - Floating-point positive infinity. Equivalent to ``float('inf')``. + Floating-point positive infinity. Equivalent to :data:`math.inf`. .. versionadded:: 3.6 @@ -338,7 +338,7 @@ Constants .. data:: nan A floating-point "not a number" (NaN) value. Equivalent to - ``float('nan')``. + :data:`math.nan`. .. versionadded:: 3.6 From f2cada918a4c3e345bd95f47e243b8ab4513d913 Mon Sep 17 00:00:00 2001 From: Aziz Date: Sun, 17 Aug 2025 15:00:55 +0200 Subject: [PATCH 2/3] Update Doc/library/cmath.rst Co-authored-by: Sergey B Kirpichev --- Doc/library/cmath.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/cmath.rst b/Doc/library/cmath.rst index 0a9f5e07dd2614..83ffea2fcd8e17 100644 --- a/Doc/library/cmath.rst +++ b/Doc/library/cmath.rst @@ -322,7 +322,7 @@ Constants .. data:: inf - Floating-point positive infinity. Equivalent to :data:`math.inf`. + Floating-point positive infinity. Equivalent to ``float('inf')``. .. versionadded:: 3.6 From 5452a2e9ebac90503745df459a1ca1efa14a53a9 Mon Sep 17 00:00:00 2001 From: Aziz Date: Sun, 17 Aug 2025 15:07:17 +0200 Subject: [PATCH 3/3] Update Doc/library/cmath.rst Co-authored-by: Sergey B Kirpichev --- Doc/library/cmath.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/cmath.rst b/Doc/library/cmath.rst index 83ffea2fcd8e17..9d2333c1ed03a1 100644 --- a/Doc/library/cmath.rst +++ b/Doc/library/cmath.rst @@ -338,7 +338,9 @@ Constants .. data:: nan A floating-point "not a number" (NaN) value. Equivalent to - :data:`math.nan`. + ``float('nan')``. + + See also :data:`math.nan`. .. versionadded:: 3.6