mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-30 07:19:38 +08:00
re PR libfortran/21376 (libfortran "E" output format causes FPE)
PR libfortran/21376 * io/write.c (output_float): Rework logic to avoid call to log10 with argument equal to zero. From-SVN: r100068
This commit is contained in:
parent
8ba8f7e557
commit
c220bdaec9
@ -1,3 +1,9 @@
|
||||
2005-05-22 Francois-Xavier Coudert <coudert@clipper.ens.fr>
|
||||
|
||||
PR libfortran/21376
|
||||
* io/write.c (output_float): Rework logic to avoid call to log10
|
||||
with argument equal to zero.
|
||||
|
||||
2005-05-21 Eric Botcazou <ebotcazou@libertysurf.fr>
|
||||
|
||||
* configure.ac: Check for trunc and truncf in libm.
|
||||
|
@ -296,6 +296,7 @@ output_float (fnode *f, double value)
|
||||
int nblanks;
|
||||
int i;
|
||||
sign_t sign;
|
||||
double abslog;
|
||||
|
||||
ft = f->format;
|
||||
w = f->u.real.w;
|
||||
@ -320,9 +321,11 @@ output_float (fnode *f, double value)
|
||||
edigits = 2;
|
||||
else
|
||||
{
|
||||
edigits = 1 + (int) log10 (fabs(log10 (value)));
|
||||
if (edigits < 2)
|
||||
abslog = fabs(log10 (value));
|
||||
if (abslog < 100)
|
||||
edigits = 2;
|
||||
else
|
||||
edigits = 1 + (int) log10 (abslog);
|
||||
}
|
||||
|
||||
if (ft == FMT_F || ft == FMT_EN
|
||||
|
Loading…
Reference in New Issue
Block a user