NaN comparison breaks threshold

Code reviewHard20 min

Your task

Review this C++ routine that finds the max of a sensor reading buffer.

A dropped sensor occasionally writes a NaN into the buffer. Downstream code gates an actuator when maxReading(v) exceeds a threshold.