diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-09-21 10:54:20 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-09-21 10:54:20 +0000 |
commit | b65d72ab8642181fb7ed9ed337e3aeff7c25007f (patch) | |
tree | 07cfac505fe19191eabf9ada0f742ec7d27503a8 | |
parent | 90d3112688947ecc4ded8bc8a64c224ed39f7a45 (diff) | |
download | gcc-b65d72ab8642181fb7ed9ed337e3aeff7c25007f.zip gcc-b65d72ab8642181fb7ed9ed337e3aeff7c25007f.tar.gz gcc-b65d72ab8642181fb7ed9ed337e3aeff7c25007f.tar.bz2 |
re PR libfortran/26253 (fallback scalbn doesn't handle denormals correctly)
PR libfortran/26253
* intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate.
From-SVN: r128648
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/intrinsics/c99_functions.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 337d2e1..79c7e13 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,5 +1,10 @@ 2007-09-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + PR libfortran/26253 + * intrinsics/c99_functions.c (scalbn): Use ldexp if appopriate. + +2007-09-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> + PR libfortran/23272 * io/unix.c (id_from_handle, id_from_path, id_from_fd): New functions. diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c index 65c284e..c9c4796 100644 --- a/libgfortran/intrinsics/c99_functions.c +++ b/libgfortran/intrinsics/c99_functions.c @@ -341,7 +341,11 @@ log10f(float x) 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 } #endif |