From 891f6675f8938ea539fa94bc80f4788835917d22 Mon Sep 17 00:00:00 2001 From: F18-Maverick Date: Tue, 4 Nov 2025 20:02:45 +0800 Subject: [PATCH 1/5] Docs: fix a form error and a grammatical error in float.rst --- Doc/c-api/float.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 489676caa3a16a..3a03a9bfedd0ad 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -96,7 +96,7 @@ NaNs (if such things exist on the platform) isn't handled correctly, and attempting to unpack a bytes string containing an IEEE INF or NaN will raise an exception. -Note that NaNs type may not be preserved on IEEE platforms (silent NaN become +Note that NaN types may not be preserved on IEEE platforms (silent NaN become quiet), for example on x86 systems in 32-bit mode. On non-IEEE platforms with more precision, or larger dynamic range, than IEEE @@ -111,7 +111,7 @@ Pack functions The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:`int` argument, non-zero if you want the bytes string in little-endian -format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you +format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal to ``1`` on big endian processor, or ``0`` on little endian processor. From c1cd87a32902d562a54f67f933e72dd486456ce9 Mon Sep 17 00:00:00 2001 From: RayXu Date: Mon, 10 Nov 2025 13:20:59 +0800 Subject: [PATCH 2/5] Fix NaN type preservation wording in float.rst Corrected the description of NaN type preservation on IEEE platforms. --- Doc/c-api/float.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index cae16c639ce1e1..b652ab18679d58 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -113,8 +113,8 @@ NaNs (if such things exist on the platform) isn't handled correctly, and attempting to unpack a bytes string containing an IEEE INF or NaN will raise an exception. -Note that NaN types may not be preserved on IEEE platforms (silent NaN become -quiet), for example on x86 systems in 32-bit mode. +Note that NaN type may not be preserved on IEEE platforms (signaling NaN become +quiet NaN), for example on x86 systems in 32-bit mode. On non-IEEE platforms with more precision, or larger dynamic range, than IEEE 754 supports, not all values can be packed; on non-IEEE platforms with less From bf04e145443767422a026e9d6da088b79a60f3e9 Mon Sep 17 00:00:00 2001 From: RayXu Date: Tue, 10 Feb 2026 10:10:48 +0800 Subject: [PATCH 3/5] Update Doc/c-api/float.rst Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- Doc/c-api/float.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index b862a02466c702..1d869305151bae 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -201,8 +201,8 @@ NaNs (if such things exist on the platform) isn't handled correctly, and attempting to unpack a bytes string containing an IEEE INF or NaN will raise an exception. -Note that NaN type may not be preserved on IEEE platforms (signaling NaN become -quiet NaN), for example on x86 systems in 32-bit mode. +Note that NaN type may not be preserved on IEEE platforms (signaling NaNs become +quiet NaNs), for example on x86 systems in 32-bit mode. On non-IEEE platforms with more precision, or larger dynamic range, than IEEE 754 supports, not all values can be packed; on non-IEEE platforms with less From 1561fc1a366a917ce62b78d8eca8ba54631a9c65 Mon Sep 17 00:00:00 2001 From: RayXu Date: Tue, 10 Feb 2026 10:11:52 +0800 Subject: [PATCH 4/5] Apply suggestion from @skirpichev Co-authored-by: Sergey B Kirpichev --- Doc/c-api/float.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 1d869305151bae..4253f1df5ed4e4 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -216,7 +216,7 @@ Pack functions The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:`int` argument, non-zero if you want the bytes string in little-endian -format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you +format (exponent last, at ``p+1``, ``p+3``, or ``p+6``, ``p+7``), zero if you want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal to ``1`` on big endian processor, or ``0`` on little endian processor. From babb1e37d3c2b884f6efbe0f19d74e4587f42f1e Mon Sep 17 00:00:00 2001 From: RayXu Date: Tue, 10 Feb 2026 22:50:05 +0800 Subject: [PATCH 5/5] Fix formatting in float.rst documentation --- Doc/c-api/float.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/float.rst b/Doc/c-api/float.rst index 4253f1df5ed4e4..1d869305151bae 100644 --- a/Doc/c-api/float.rst +++ b/Doc/c-api/float.rst @@ -216,7 +216,7 @@ Pack functions The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:`int` argument, non-zero if you want the bytes string in little-endian -format (exponent last, at ``p+1``, ``p+3``, or ``p+6``, ``p+7``), zero if you +format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you want big-endian format (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal to ``1`` on big endian processor, or ``0`` on little endian processor.