Skip to content

Commit 11c25b8

Browse files
authored
bpo-46906: Mention native endian in PyFloat_Pack8() doc (GH-31866)
1 parent f00ced8 commit 11c25b8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Doc/c-api/float.rst

+6-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ Pack functions
109109
The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an
110110
:c:type:`int` argument, non-zero if you want the bytes string in little-endian
111111
format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you
112-
want big-endian format (exponent first, at *p*).
112+
want big-endian format (exponent first, at *p*). The :c:data:`PY_BIG_ENDIAN`
113+
constant can be used to use the native endian: it is equal to ``1`` on big
114+
endian processor, or ``0`` on little endian processor.
113115
114116
Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set,
115117
most likely :exc:`OverflowError`).
@@ -138,7 +140,9 @@ Unpack functions
138140
The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an
139141
:c:type:`int` argument, non-zero if the bytes string is in little-endian format
140142
(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-endian
141-
(exponent first, at *p*).
143+
(exponent first, at *p*). The :c:data:`PY_BIG_ENDIAN` constant can be used to
144+
use the native endian: it is equal to ``1`` on big endian processor, or ``0``
145+
on little endian processor.
142146
143147
Return value: The unpacked double. On error, this is ``-1.0`` and
144148
:c:func:`PyErr_Occurred` is true (and an exception is set, most likely

0 commit comments

Comments
 (0)