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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|quadmath fminq/fmaxq with   |fmin/fmax with
                   |signaling_NaN not work      |signaling_NaN not work

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
With `-fsignaling-nans` added, then we get the :
inf
inf
nan
nan

so ...

Even using float instead also cause the same output:
```
#include <type_traits>
#include <iostream>
#include <stdfloat>
#include <limits>
#include <cmath>

int main()
{
    {
        using T = float;
        using L = std::numeric_limits<T>;
        const T
            a = L::infinity(),
            b = L::quiet_NaN(),
            c = L::signaling_NaN();

        std::cout << "float\n";
        std::cout << std::fmin(a, b) << std::endl;
        std::cout << std::fmax(a, b) << std::endl;
        std::cout << std::fmin(a, c) << std::endl;
        std::cout << std::fmax(a, c) << std::endl;
    }
}
```

So Looks like we convert sNaN to qNan if `-fsignaling-nans` is not supplied ...

Reply via email to