This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/82207] ieee_class identifies signaling NaNs as quiet NaNs


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

--- Comment #2 from kargl at gcc dot gnu.org ---
See gcc/gcc/libgfortran/ieee/ieee_helper.c lines 75-79:

    if (res == IEEE_QUIET_NAN) \
    { \
      /* TODO: Handle signaling NaNs  */ \
      return res; \
    } \

See also gcc/gcc/libgfortran/ieee/ieee_arithmetic.F90
lines 860-871

  elemental real(kind=4) function IEEE_VALUE_4(X, CLASS) result(res)

    real(kind=4), intent(in) :: X
    type(IEEE_CLASS_TYPE), intent(in) :: CLASS

    select case (CLASS%hidden)
      case (1)     ! IEEE_SIGNALING_NAN
        res = -1
        res = sqrt(res)
      case (2)     ! IEEE_QUIET_NAN
        res = -1
        res = sqrt(res)

It seems gfortran supports NaN, but does not make a distinction
between a quiet and a signal NaN.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]