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

Use M_PI instead of M_PIl #96

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

Conversation

cmumford
Copy link

M_PIl is the double precision constant for pi (3.14...). This is not defined in all toolchains, resulting in the following build error:

test/testcpp.cc:46:35: error: use of undeclared identifier 'M_PIl'; did you mean 'P_PID'?
     46 |         long double phinc = 2*k0* M_PIl / nfft;
        |                                   ^~~~~
        |                                   P_PID

The double precision constants may be a GNU extension. See: https://www.gnu.org/software/libc/manual/html_node/Mathematical-Constants.html_node

Switching the test to use the single precision M_PI avoids this error. The test still passes as the added precision of the double is not required.

This fixes #87.

M_PIl is the double precision constant for pi (3.14...).
This is not defined in all toolchains, resulting in the
following build error:

```
test/testcpp.cc:46:35: error: use of undeclared identifier 'M_PIl'; did you mean 'P_PID'?
     46 |         long double phinc = 2*k0* M_PIl / nfft;
        |                                   ^~~~~
        |                                   P_PID
```

The double precision constants may be a GNU extension. See:
https://www.gnu.org/software/libc/manual/html_node/Mathematical-Constants.html_node

Switching the test to use the single precision M_PI avoids this
error. The test still passes as the added precision of the
double is not required.

This fixes mborgerding#87.
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.

Typo in testcpp.cc
1 participant