在 2023/4/11 16:00, Richard Biener via Gcc 写道: > I think without NaNs MIN/MAX cannot raise any exceptions (I'm not > even sure whether MIN/MAX involving NaN will set invalid, but > most certainly with sNaN it will trap and return a quiet NaN?). > The C standard doesn't > document any exceptions for fmax/fmin (even with NaN), but > meanwhile there's a plethora of min/max function variants ... My interpretation is that if one argument is a SNaN and the other is not, `fmax()` shall return the SNaN unchanged, without converting it to a QNaN. (F.10.9.2 The fmax functions, ISO/IEC 9899:2017) -- Best regards, LIU Hao