See this thread:
https://forums.garmin.com/developer/connect-iq/f/discussion/338071/testing-for-nan/1637852#1637852
The following code snippet works
var rad = NaN;
System.println("rad == NaN: " + (rad == NaN)); // false
System.println("rad.equals(NaN): " + rad.equals(NaN)); // true
It returns
rad == NaN:false
rad.equals(NaN):
true
The following code snippet does NOT work
var rad = Math.acos(45);
System.println("rad == NaN: " + (rad == NaN)); // false
System.println("rad.equals(NaN): " + rad.equals(NaN)); // true
It returns
rad == NaN:false
rad.equals(NaN):
false
In both cases, rad is NaN (Lang.Float) but in the bottom one, both line returns 'false'. How can one check for NaN returned from a Math function???
Running CIQ 4.2.4.