This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/64370] [5 Regression] sreal.c:125:23: error: 'exp2' was not declared in this scope
- From: "maltsevm at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 09 Jan 2015 19:25:26 +0000
- Subject: [Bug other/64370] [5 Regression] sreal.c:125:23: error: 'exp2' was not declared in this scope
- Auto-submitted: auto-generated
- References: <bug-64370-4 at http dot gcc dot gnu dot org/bugzilla/>
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?