https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103605

--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot 
com> ---
On Tue, 26 Apr 2022, guihaoc at gcc dot gnu.org via Gcc-bugs wrote:

> C99/11 standard
> If just one argument is a NaN, the fmin functions return the other argument 
> (if
> both arguments are NaNs, the functions return a NaN).
> fmin(NaN, 3.0) = fmin(3.0, NaN) = 3.0

"NaN" here means quiet NaN.

> xsmindp
> The minimum of a QNaN and any value is that value. The minimum of any value 
> and
> an SNaN is that SNaN converted to a QNaN.
> xsmindp(NaN, 3.0) = 3.0 xsmindp(3.0, NaN) = NaN

That seems right for fmin, provided that (QNaN, SNaN) arguments in either 
order produce a QNaN result (with "invalid" raised).  Note that fmin and 
fmax follow the old operations from IEEE 754-2008 (that aren't associative 
in the presence of SNaN), not any of the new operations from IEEE 
754-2019.

Reply via email to