C
Cephas
How do i write an if statement that checks the results of a operation
to see if its nan (not a number) or not? *using g++, a linux complier*
I tried
double x;
if (x == nan)
{
code here
}
but nan isnt a built in defined varible.
I cant say:
if (x == 0)
because that means it holds a value of a number.
I am performing a complex mathimatical equation on diffrent variables
and need to create a if statement for the times that my equation
returns NaN.
Thanks!
-Cephas
to see if its nan (not a number) or not? *using g++, a linux complier*
I tried
double x;
if (x == nan)
{
code here
}
but nan isnt a built in defined varible.
I cant say:
if (x == 0)
because that means it holds a value of a number.
I am performing a complex mathimatical equation on diffrent variables
and need to create a if statement for the times that my equation
returns NaN.
Thanks!
-Cephas