]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Mention _Float16 (type from Annex H of the C23) in the struct docs (GH-146243...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 27 Mar 2026 17:44:29 +0000 (18:44 +0100)
committerGitHub <noreply@github.com>
Fri, 27 Mar 2026 17:44:29 +0000 (17:44 +0000)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Doc/conf.py
Doc/library/struct.rst

index 1e361f88d6f5d94cd8e77d041b4289870c8c3d83..b218e3e7c0464e4730f68820ef8433ab134060fa 100644 (file)
@@ -167,6 +167,7 @@ nitpick_ignore = [
     ('c:type', '__int64'),
     ('c:type', 'unsigned __int64'),
     ('c:type', 'double'),
+    ('c:type', '_Float16'),
     # Standard C structures
     ('c:struct', 'in6_addr'),
     ('c:struct', 'in_addr'),
index 4769affdf1d666217c05982e5125648d5150729f..77da141bfbffae37ee009bdfa5ddbbc4504bad9b 100644 (file)
@@ -254,7 +254,7 @@ platform-dependent.
 +--------+--------------------------+--------------------+----------------+------------+
 | ``N``  | :c:type:`size_t`         | integer            |                | \(3)       |
 +--------+--------------------------+--------------------+----------------+------------+
-| ``e``  | \(6)                     | float              | 2              | \(4)       |
+| ``e``  | :c:expr:`_Float16`       | float              | 2              | \(4), \(6) |
 +--------+--------------------------+--------------------+----------------+------------+
 | ``f``  | :c:expr:`float`          | float              | 4              | \(4)       |
 +--------+--------------------------+--------------------+----------------+------------+
@@ -315,7 +315,9 @@ Notes:
    revision of the `IEEE 754 standard <ieee 754 standard_>`_. It has a sign
    bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored),
    and can represent numbers between approximately ``6.1e-05`` and ``6.5e+04``
-   at full precision. This type is not widely supported by C compilers: on a
+   at full precision. This type is not widely supported by C compilers:
+   it's available as :c:expr:`_Float16` type, if the compiler supports the Annex H
+   of the C23 standard.  On a
    typical machine, an unsigned short can be used for storage, but not for math
    operations. See the Wikipedia page on the `half-precision floating-point
    format <half precision format_>`_ for more information.