diff --git a/test/testcpp.cc b/test/testcpp.cc index 11ab291..b9dee94 100644 --- a/test/testcpp.cc +++ b/test/testcpp.cc @@ -7,6 +7,7 @@ */ #include "kissfft.hh" #include +#include #include #include @@ -41,9 +42,14 @@ void dotest(int nfft) long double totalpower=0; long double difpower=0; + + // Create long double constant for pi because M_PIl is not defined by + // all toolchains. + const long double pi = std::acosl(-1); + for (int k0=0;k0 acc = 0; - long double phinc = 2*k0* M_PI / nfft; + long double phinc = 2*k0* pi / nfft; for (int k1=0;k1 x(inbuf[k1].real(),inbuf[k1].imag()); acc += x * exp( complex(0,-k1*phinc) );