Skip to content

Commit 15c6b2b

Browse files
skirpichevhugovk
andauthored
Apply suggestions from code review
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 83b7adb commit 15c6b2b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Doc/c-api/float.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,12 @@ string from a C :c:expr:`double`, and the Unpack routines produce a C
192192
:c:expr:`double` from such a bytes string. The suffix (2, 4 or 8) specifies the
193193
number of bytes in the bytes string.
194194
195-
The 2-byte format is the IEEE 754 binary16 half-precision format, the 4-byte
196-
format is the IEEE 754 binary32 single precision format, and the 8-byte format
197-
is the IEEE 754 binary64 double precision format, although the NaN type may
198-
not be preserved on some platforms while unpacking (signaling NaNs become quiet
199-
NaNs), for example on x86 systems in 32-bit mode.
195+
* The 2-byte format is the IEEE 754 binary16 half-precision format.
196+
* The 4-byte format is the IEEE 754 binary32 single-precision format.
197+
* The 8-byte format is the IEEE 754 binary64 double-precision format.
198+
199+
The NaN type may not be preserved on some platforms while unpacking (signaling
200+
NaNs become quiet NaNs), for example on x86 systems in 32-bit mode.
200201
201202
It's assumed that the :c:expr:`double` type has the IEEE 754 binary64 double
202203
precision format. What happens if it's not true is partly accidental (alas).
@@ -215,8 +216,8 @@ Pack functions
215216
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
216217
:c:expr:`int` argument, non-zero if you want the bytes string in little-endian
217218
format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` and ``p+7``), zero if you
218-
want big-endian format (exponent first, at *p*). The :c:macro:`!PY_LITTLE_ENDIAN`
219-
constant can be used to use the native endian: it is equal to ``0`` on big
219+
want big-endian format (exponent first, at *p*). Use the :c:macro:`!PY_LITTLE_ENDIAN`
220+
constant to select the native endian: it is equal to ``0`` on big
220221
endian processor, or ``1`` on little endian processor.
221222
222223
Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set,
@@ -244,8 +245,8 @@ Unpack functions
244245
The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an
245246
:c:expr:`int` argument, non-zero if the bytes string is in little-endian format
246247
(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-endian
247-
(exponent first, at *p*). The :c:macro:`!PY_LITTLE_ENDIAN` constant can be used to
248-
use the native endian: it is equal to ``0`` on big endian processor, or ``1``
248+
(exponent first, at *p*). Use the :c:macro:`!PY_LITTLE_ENDIAN` constant to
249+
select the native endian: it is equal to ``0`` on big endian processor, or ``1``
249250
on little endian processor.
250251
251252
Return value: The unpacked double. On error, this is ``-1.0`` and

0 commit comments

Comments
 (0)