View Single Post
  #8   Spotlight this post!  
Unread 12-02-2011, 23:03
mandrews281 mandrews281 is offline
Registered User
FRC #0281
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Greenville SC
Posts: 82
mandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to beholdmandrews281 is a splendid one to behold
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
Reply With Quote