I am trying to check whether a number std::complexthat is the result of a Fourier transform (using http://fftw.org/ ) contains NaNboth the real and the imaginary part.
I am using Borland C ++, so I do not have access to std::isnan. I tried to check if the number NaNis by comparing it with myself:
(n.imag() != n.imag())
However, as soon as I call n.imag()or std::imag(n), I get an "invalid floating point operation".
Is there any way to verify the correctness std::complex; if it contains a NaN?
dagur source
share