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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The M_PI macro is not part of the C / C ++ language standard. #31

Open
WojAbuk opened this issue Feb 14, 2022 · 1 comment
Open

The M_PI macro is not part of the C / C ++ language standard. #31

WojAbuk opened this issue Feb 14, 2022 · 1 comment

Comments

@WojAbuk
Copy link

WojAbuk commented Feb 14, 2022

#ifndef M_PI
#define M_PI acos(-1)
#endif

The code snippet after #include <math.h> guarantees correct operation. It would be better to additionally check that we do not have a C ++ 20 or newer vessel and if we are to use the stencil constant from the C ++ standard library. The M_PI macro is an extension of the C standard.

@ziobron
Copy link
Contributor

ziobron commented Feb 14, 2022

🏅 2 XP granted for @WojAbuk
Thanks for raising this Issue to help to make the course better!

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

No branches or pull requests

2 participants