|
Re: Testing for infinity
I don't have WindRiver anywhere near me at the moment, but assuming math.h exists, there are functions like isinf(x) and/or the constants FP_INFINITE and FP_NAN in the floating point standards. So you might be able to write
#include <math.h>
if (isinf(1.0/0.0)) {
do something
}
On most development systems, including math.h that means you also need to link against the math library (-lm). I don't know if WindRiver would do that automatically.
__________________
Michael Andrews
Team #281 Programming Mentor
|