isnan in C++

Hi All,

I am tryign convert some java code to C++. Not sure is there is a isnan method in C++. Any advices?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
#include <math.h>

void MyFunction{double InputOne, double InputTwo)
double test;
test=InputOne/InputTwo;
if (isnan(test)){
    //
    //
}else{
    //
    //
}

}
Ensure you're not dividing by zero.

Otherwise, you're into the realms of non-portable behaviour: http://stackoverflow.com/questions/570669/checking-if-a-double-or-float-is-nan-in-c
Topic archived. No new replies allowed.