How to represent infinity in NXC?
I don't believe that a constant or macro is available in NXC for positive infinity. C99 defines INFINITY in math.h, but the math module in NXC does not appear to include this.

NXC uses IEEE 754 floating point, so something like this should give you the raw value of infinity cast to a float:

int raw_infinity = 0x7f800000;
const float INFINITY = *(float*)&amp;raw_infinity;


I don't have a way to test this currently, and I'm not sure how the underlying firmware and hardware handle special floating point values, so this may or may not actually meet your needs.