mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-10 11:12:58 -08:00
While looking for the optimal length to print a floating point number, write_double() may cause some underflow exceptions, which are harmless and should be masks.
This commit is contained in:
parent
0deebf6f4f
commit
c7e83eeba9
1 changed files with 10 additions and 0 deletions
|
|
@ -22,6 +22,9 @@
|
|||
#ifndef _MSC_VER
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_FENV_H
|
||||
#include <fenv.h>
|
||||
#endif
|
||||
#include "ecl.h"
|
||||
#include "internal.h"
|
||||
#include "bytecodes.h"
|
||||
|
|
@ -544,6 +547,10 @@ static void
|
|||
write_double(double d, int e, bool shortp, cl_object stream)
|
||||
{
|
||||
int exp;
|
||||
#if defined(HAVE_FENV_H) || defined(_MSC_VER) || defined(mingw32)
|
||||
fenv_t env;
|
||||
feholdexcept(&env);
|
||||
#endif
|
||||
if (d < 0) {
|
||||
write_ch('-', stream);
|
||||
d = -d;
|
||||
|
|
@ -600,6 +607,9 @@ write_double(double d, int e, bool shortp, cl_object stream)
|
|||
}
|
||||
write_decimal(exp, stream);
|
||||
}
|
||||
#if defined(HAVE_FENV_H) || defined(_MSC_VER) || defined(mingw32)
|
||||
fesetenv(&env);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue