On Wed, 26 Jan 2022, Maciej W. Rozycki wrote:

> > The newer instruction semantics correspond to the functions fminimum_num 
> > and fmaximum_num, not fminimum and fmaximum (which are functions that 
> > treat both quiet and signaling NaNs like most libm functions do - any 
> > argument a NaN means the result is NaN).
> 
>  I got these wrong then, sorry.  I got lost too: what is the difference 
> between `fmin'/`fmax' and `fminimum'/`fmaximum' then?  It looks to me like 
> we have a zoo of selection functions now with very subtle differences 
> between each other.

fmin and fmax:

* Treat quiet NaN as missing data and return the other argument (if a 
number).

* Treat signaling NaN like most functions (raise invalid, return quiet 
NaN).

fminimum and fmaximum:

* Treat quiet NaN like most functions (return quiet NaN, no exceptions 
raised unless the other argument is signaling NaN).

* Treat signaling NaN like most functions (raise invalid, return quiet 
NaN).

fminimum_num and fmaximum_num:

* Treat both quiet and signaling NaN as missing data and return the other 
argument (if a number).  "invalid" is still raised if one argument is a 
signaling NaN (contrary to the normal rule that raising "invalid" means 
also returning a quiet NaN).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to