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.
maxReading(v)