Update.
1999-07-28 Ulrich Drepper <drepper@cygnus.com> * misc/efgcvt.c: Use IEEE 854 formula to compute the number of digits to print. * misc/efgcvt_r.c: Likewise. * misc/qefgcvt.c: Likewise. * misc/qefgcvt_r.c: Likewise. * misc/tst-efgcvt.c: Remove one test which cannot reliably be run anymore.
This commit is contained in:
parent
aa847ee5a4
commit
b113c12c35
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
1999-07-28 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* misc/efgcvt.c: Use IEEE 854 formula to compute the number of digits
|
||||||
|
to print.
|
||||||
|
* misc/efgcvt_r.c: Likewise.
|
||||||
|
* misc/qefgcvt.c: Likewise.
|
||||||
|
* misc/qefgcvt_r.c: Likewise.
|
||||||
|
* misc/tst-efgcvt.c: Remove one test which cannot reliably be run
|
||||||
|
anymore.
|
||||||
|
|
||||||
1999-07-27 Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
1999-07-27 Andreas Jaeger <aj@arthur.rhein-neckar.de>
|
||||||
|
|
||||||
* manual/math.texi (FP Function Optimization): Mention drawbacks.
|
* manual/math.texi (FP Function Optimization): Mention drawbacks.
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
@ -29,8 +30,13 @@
|
||||||
# define FLOAT_FMT_FLAG
|
# define FLOAT_FMT_FLAG
|
||||||
/* Actually we have to write (DBL_DIG + log10 (DBL_MAX_10_EXP)) but we
|
/* Actually we have to write (DBL_DIG + log10 (DBL_MAX_10_EXP)) but we
|
||||||
don't have log10 available in the preprocessor. */
|
don't have log10 available in the preprocessor. */
|
||||||
# define MAXDIG (DBL_DIG + 3)
|
# define MAXDIG (NDIGIT_MAX + 3)
|
||||||
# define NDIGIT_MAX DBL_DIG
|
# if DBL_MANT_DIG == 53
|
||||||
|
# define NDIGIT_MAX 17
|
||||||
|
# else
|
||||||
|
/* See IEEE 854 5.6, table 2 for this formula. */
|
||||||
|
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0)))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define APPEND(a, b) APPEND2 (a, b)
|
#define APPEND(a, b) APPEND2 (a, b)
|
||||||
|
|
|
@ -30,7 +30,12 @@
|
||||||
# define FUNC_PREFIX
|
# define FUNC_PREFIX
|
||||||
# define FLOAT_FMT_FLAG
|
# define FLOAT_FMT_FLAG
|
||||||
# define FLOAT_NAME_EXT
|
# define FLOAT_NAME_EXT
|
||||||
# define NDIGIT_MAX DBL_DIG
|
# if DBL_MANT_DIG == 53
|
||||||
|
# define NDIGIT_MAX 17
|
||||||
|
# else
|
||||||
|
/* See IEEE 854 5.6, table 2 for this formula. */
|
||||||
|
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0)))
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define APPEND(a, b) APPEND2 (a, b)
|
#define APPEND(a, b) APPEND2 (a, b)
|
||||||
|
|
|
@ -17,13 +17,20 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#define FLOAT_TYPE long double
|
#define FLOAT_TYPE long double
|
||||||
#define FUNC_PREFIX q
|
#define FUNC_PREFIX q
|
||||||
#define FLOAT_FMT_FLAG "L"
|
#define FLOAT_FMT_FLAG "L"
|
||||||
/* Actually we have to write (LDBL_DIG + log10 (LDBL_MAX_10_EXP)) but
|
/* Actually we have to write (LDBL_DIG + log10 (LDBL_MAX_10_EXP)) but
|
||||||
we don't have log10 available in the preprocessor. Since we cannot
|
we don't have log10 available in the preprocessor. Since we cannot
|
||||||
assume anything on the used `long double' format be generous. */
|
assume anything on the used `long double' format be generous. */
|
||||||
#define MAXDIG (LDBL_DIG + 12)
|
#define MAXDIG (NDIGIT_MAX + 12)
|
||||||
#define NDIGIT_MAX LDBL_DIG
|
#if LDBL_MANT_DIG == 64
|
||||||
|
# define NDIGIT_MAX 21
|
||||||
|
#else
|
||||||
|
/* See IEEE 854 5.6, table 2 for this formula. */
|
||||||
|
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0)))
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "efgcvt.c"
|
#include "efgcvt.c"
|
||||||
|
|
|
@ -18,10 +18,17 @@
|
||||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
Boston, MA 02111-1307, USA. */
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#define FLOAT_TYPE long double
|
#define FLOAT_TYPE long double
|
||||||
#define FUNC_PREFIX q
|
#define FUNC_PREFIX q
|
||||||
#define FLOAT_FMT_FLAG "L"
|
#define FLOAT_FMT_FLAG "L"
|
||||||
#define FLOAT_NAME_EXT l
|
#define FLOAT_NAME_EXT l
|
||||||
# define NDIGIT_MAX LDBL_DIG
|
#if LDBL_MANT_DIG == 64
|
||||||
|
# define NDIGIT_MAX 21
|
||||||
|
#else
|
||||||
|
/* See IEEE 854 5.6, table 2 for this formula. */
|
||||||
|
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0)))
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "efgcvt_r.c"
|
#include "efgcvt_r.c"
|
||||||
|
|
|
@ -56,7 +56,6 @@ static testcase ecvt_tests[] =
|
||||||
{ 123.01, -4, 3, "" },
|
{ 123.01, -4, 3, "" },
|
||||||
{ 126.71, -4, 3, "" },
|
{ 126.71, -4, 3, "" },
|
||||||
{ 0.0, 4, 1, "0000" },
|
{ 0.0, 4, 1, "0000" },
|
||||||
{ 92.0, 16, 2, "920000000000000" },
|
|
||||||
/* -1.0 is end marker. */
|
/* -1.0 is end marker. */
|
||||||
{ -1.0, 0, 0, "" }
|
{ -1.0, 0, 0, "" }
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,7 @@ mbtowc (wchar_t *pwc, const char *s, size_t n)
|
||||||
|
|
||||||
/* This is an extension in the Unix standard which does not directly
|
/* This is an extension in the Unix standard which does not directly
|
||||||
violate ISO C. */
|
violate ISO C. */
|
||||||
memset (&__no_r_state, '\0', siyeof __no_r_state);
|
memset (&__no_r_state, '\0', sizeof __no_r_state);
|
||||||
|
|
||||||
result = __wcsmbs_gconv_fcts.towc->__stateful;
|
result = __wcsmbs_gconv_fcts.towc->__stateful;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ wctomb (char *s, wchar_t wchar)
|
||||||
|
|
||||||
/* This is an extension in the Unix standard which does not directly
|
/* This is an extension in the Unix standard which does not directly
|
||||||
violate ISO C. */
|
violate ISO C. */
|
||||||
memset (&__no_r_state, '\0', siyeof __no_r_state);
|
memset (&__no_r_state, '\0', sizeof __no_r_state);
|
||||||
|
|
||||||
return __wcsmbs_gconv_fcts.tomb->__stateful;
|
return __wcsmbs_gconv_fcts.tomb->__stateful;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue