F.9.9.2 The fmax functions
If just one argument is a NaN, the fmax functions return the other argument (if both arguments are NaNs, the functions return a NaN).
The body of the fmax function might be[1]
{ return (isgreaterequal(x, y) ||
isnan(y)) ? x : y; }
Footnotes