[Bug other/64370] [5 Regression] sreal.c:125:23: error: 'exp2' was not declared in this scope
maltsevm at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jan 9 19:25:00 GMT 2015
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?
More information about the Gcc-bugs
mailing list