Skip to content
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 our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floating-point/double is used, i.e. "optional" IEEE in C[11] #3593

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PallHaraldsson
Copy link

@PallHaraldsson PallHaraldsson commented Dec 16, 2023

It may be unclear to many but C does not specify floating point. I.e. what float and double mean exactly. But Python's floats use double/Float64.

So that means at least one optional C feature is used, Annex F (__STDC_IEC_559__)?

This is sort of a nitpick/question.

But another issue with this PEP is "XP" unexplained. I believe it means "extreme programming", and maybe it's best to link it. Not all may be familiar so maybe it's NOT better to (simply) spell it out.

https://stackoverflow.com/questions/31181897/status-of-stdc-iec-559-with-modern-c-compilers

https://softwarerecs.stackexchange.com/questions/78793/is-there-any-c-compiler-which-defines-both-stdc-and-stdc-iec-559-to-1

https://gcc.gnu.org/onlinedocs/gcc/Floating-point-implementation.html

The accuracy of the floating-point operations and of the library functions in <math.h> and <complex.h> that return floating-point results (C90, C99 and C11 5.2.4.2.2).
The accuracy is unknown.


馃摎 Documentation preview 馃摎: https://pep-previews--3593.org.readthedocs.build/

Copy link

The following commit authors need to sign the Contributor License Agreement:

Click the button to sign:
CLA not signed

@gvanrossum
Copy link
Member

I feel that the addition, as proposed, does not make the PEP clearer for most people. And IEEE floating point is what鈥檚 provided by all supported platforms.

@PallHaraldsson
Copy link
Author

I think at least https://en.wikipedia.org/wiki/Extreme_programming or other link for XP could be added.

I know you can by now expect IEEE floating point, and in all C compilers. Maybe write "C11 with IEEE floating-point, and otherwise no optional features"?

I forget does Python use 64-bit floats on all platforms, or 80-bit (registers) on x86 (with 64-bit for storage format)?

@encukou
Copy link
Member

encukou commented Dec 18, 2023

Would it be better to list the optional features? Or remove the note entirely, and leave the necessary standards extensions unspecified?

In addition to the Annex F floats, CPython 3.13 now also needs C11 atomics (or MSVC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants