Hello.
I am using real_isfinite to check for overflow conditions. How should
I check for underflow? I have tried different ways but they
contradicted other cases to pass.

static bool
fold_const_narrow_binary (real_value *result, const real_value *arg0,
              int icode, const real_value *arg1,
              const real_format *format)
{
  if (REAL_VALUE_ISSIGNALING_NAN (*arg0)
      || REAL_VALUE_ISSIGNALING_NAN (*arg1))
    return false;

  real_arithmetic (result, icode, arg0, arg1);
  if (!exact_real_truncate (format, result)
      && (flag_rounding_math || flag_trapping_math))
    return false;

  real_convert (result, format, result);
  /* Overflow condition.  */
  if (!real_isfinite (result) && flag_errno_math)
    return false;

  if (REAL_VALUE_ISNAN (*result)
      && (flag_errno_math || flag_trapping_math))
    return false;
  return true;
}

Thanks,
Tejas

Reply via email to