ich persönlich bin nicht überzeugt, dass der Code valide ist, immerhin ist allerdings in Arduinisch einiges möglich, was sonst in C so nicht möglich ist.
Aber es ist ja auch C++ im Hintergrund: Wer weiß, welche Klassen da verdeckt eingeschlossen wurden, welche Exceptions da verdeckt ausgelöst werden, und was da privat oder public ist.
Die Tatsache, dass der Code bei dir aber nicht kompiliert wird, stützt zumindest meine Zweifel.

- - - Aktualisiert - - -

hier findet man weiterführende Erklärungen:

http://stackoverflow.com/questions/1...n-and-inf-in-c

The existence of INFINITY is guaranteed by C99 (or the latest draft at least), and "expands to a constant expression of type float representing positive or unsigned infinity, if available; else to a positive constant of type float that overflows at translation time."

NAN may or may not be defined, and "is defined if and only if the implementation supports quiet NaNs for the float type. It expands to a constant expression of type float representing a quiet NaN."

Note that if you're comparing floating point values, and do:

a = NAN;

even then,

a == NAN;

is false.
One way to check for NaN would be:

#include <math.h>
if (isnan(a)) { ... }

You can also do: a != a to test if a is NaN.

There is also isfinite(), isinf(), isnormal(), and signbit() macros in math.h in C99.

C99 also has nan functions:

#include <math.h>
double nan(const char *tagp);
float nanf(const char *tagp);
long double nanl(ocnst char *tagp);