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 other/64370] [5 Regression] sreal.c:125:23: error: 'exp2' was not declared in this scope


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

Mikhail Maltsev <maltsevm at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maltsevm at gmail dot com

--- Comment #3 from Mikhail Maltsev <maltsevm at gmail dot com> ---
In libgfortran/intrinsics/c99_functions.c, scalbn is implemented like this:

double
scalbn (double x, int y)
{
#if (FLT_RADIX == 2) && defined(HAVE_LDEXP)
  return ldexp (x, y); 
#else
  return x * pow (FLT_RADIX, y); 
#endif
}

Maybe something similar could be used here. If pow is not OK, something like
this could be used:
return (y >= 0) ? x * (1 << y) : x / (1 << (-y)); (assuming that shift will not
cause overflow).

BTW, what if FLT_RADIX != 2?


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