Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-61103: don't use native complex types in ctypes#133237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
encukou merged 6 commits intopython:mainfromskirpichev:no_complex.h/61103
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Apply suggestions from code review
Co-authored-by: Petr Viktorin <encukou@gmail.com>
  • Loading branch information
@skirpichev@encukou
skirpichev andencukou authoredMay 1, 2025
commitf1fa51bab386a2323aefc9e82570866361c6ce4a
9 changes: 4 additions & 5 deletionsDoc/library/struct.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -360,11 +360,10 @@ Notes:
For the ``'E'`` and ``'C'`` format characters, the packed representation uses
the IEEE 754 binary32 and binary64 format for components of the complex
number, regardless of the floating-point format used by the platform.
Note that support for complex types is available unconditionally,
regardless on support IEC 60559 compatible complex arithmetic (Annex G of
the C11 standard) by the compiler. Each complex type is interpreted as an
array type containing exactly two elements of the corresponding real type
(real and imaginary parts, respectively).
Note that complex types (``F`` and ``D``) are available unconditionally,
despite complex types being an optional feature in C.
As specified in the C11 standard, each complex type is represented by a
two-element C array containing, respectively, the real and imaginary parts.


A format character may be preceded by an integral repeat count. For example,
Expand Down
2 changes: 1 addition & 1 deletionModules/_ctypes/cfield.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -761,7 +761,7 @@ d_get(void *ptr, Py_ssize_t size)

#if defined(Py_FFI_SUPPORT_C_COMPLEX)

/* We don't useAnnex G complextypes here, using arrays instead, as theC17+
/* We don't use_Complextypes here, using arrays instead, as theC11+
standard says: "Each complex type has the same representation and alignment
requirements as an array type containing exactly two elements of the
corresponding real type; the first element is equal to the real part, and
Expand Down
Loading

[8]ページ先頭

©2009-2026 Movatter.jp