jacob navia wrote:
jacob navia wrote:
>>
In C99 this is ONLY defined for real types. No definition for
complex types. What is the definition in C++?
>insan(z) --isnan(real(z)) || isnan(imag(z))
If you want to program an "isnan" function for std::complex<T>, then I
suggest you to use the above function.
If one of the parts is an invalid real number then your whole complex
number should be invalid.
The same reasoning goes for isinf. If one of your complex numbers is
infinite, then your complex number is one of the many representations of
infinite.
Klaas