about summary refs log tree commit diff
path: root/ChangeLog
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2015-10-01 15:24:54 +0000
committerJoseph Myers <joseph@codesourcery.com>2015-10-01 15:24:54 +0000
commite27fcd027cbdc2f13bf440177c0434eb9ec3dd28 (patch)
tree8b653db2c0bbc46e46589ed9c2853baf23659dff /ChangeLog
parent7cda516f5f23772fd37ca3a5e018fca5bf388435 (diff)
downloadglibc-e27fcd027cbdc2f13bf440177c0434eb9ec3dd28.tar.gz
glibc-e27fcd027cbdc2f13bf440177c0434eb9ec3dd28.tar.xz
glibc-e27fcd027cbdc2f13bf440177c0434eb9ec3dd28.zip
Use type-specific precision when printing results in libm-test.inc.
When libm-test.inc prints the results of failing tests, the output can
be unhelpful for ldbl-128 and ldbl-128ibm because the precision used
is insufficient to distinguish values of those types, resulting in
reported values that look identical but differ by a large number of
ulps.

This patch changes it to use a precision appropriate for the type, for
both decimal and hex output (so output for float is more compact,
output for ldbl-128 and ldbl-128ibm is substantially wider).  The
natural precision to use for decimal is given by the C11 <float.h>
macros such as FLT_DECIMAL_DIG.  GCC's <float.h> only defines those in
C11 mode, so this patch uses the predefines such as
__FLT_DECIMAL_DIG__ (added in GCC 4.6) instead; if we move to building
with -std=gnu11 (or -std=gnu1x if we can't get rid of 4.6 support).

Tested for powerpc and mips64.

	* math/libm-test.inc (TYPE_DECIMAL_DIG): New macro.
	(TYPE_HEX_DIG): Likewise.
	(print_float): Use TYPE_DECIMAL_DIG - 1 and TYPE_HEX_DIG - 1 as
	precisions when printing floating-point numbers.
	(check_float_internal): Likewise.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog8
1 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a88defa9f6..6da0652f4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-10-01  Joseph Myers  <joseph@codesourcery.com>
+
+	* math/libm-test.inc (TYPE_DECIMAL_DIG): New macro.
+	(TYPE_HEX_DIG): Likewise.
+	(print_float): Use TYPE_DECIMAL_DIG - 1 and TYPE_HEX_DIG - 1 as
+	precisions when printing floating-point numbers.
+	(check_float_internal): Likewise.
+
 2015-09-30  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #16620]