about summary refs log tree commit diff
path: root/stdlib/tst-strtod-round.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-11-13 12:59:54 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-11-13 12:59:54 +0000
commit9310c284ae91f13247c9dd7ff58fc2683b9c523d (patch)
tree86478302002c020e38bc75f43abce8ecb37528b1 /stdlib/tst-strtod-round.c
parent7a2ad8cf392acfcaef319e722dda9101d4d8b6bd (diff)
downloadglibc-9310c284ae91f13247c9dd7ff58fc2683b9c523d.tar.gz
glibc-9310c284ae91f13247c9dd7ff58fc2683b9c523d.tar.xz
glibc-9310c284ae91f13247c9dd7ff58fc2683b9c523d.zip
Fix strtod rounding of half the least subnormal (bug 16151).
Diffstat (limited to 'stdlib/tst-strtod-round.c')
-rw-r--r--stdlib/tst-strtod-round.c288
1 files changed, 288 insertions, 0 deletions
diff --git a/stdlib/tst-strtod-round.c b/stdlib/tst-strtod-round.c
index 9a440264d0..e7aaed17e8 100644
--- a/stdlib/tst-strtod-round.c
+++ b/stdlib/tst-strtod-round.c
@@ -7535,6 +7535,294 @@ static const struct test tests[] = {
 	-0x0p+0L,
 	-0x0p+0L,
 	-0x0p+0L),
+  TEST ("0x1p-150",
+	false,
+	0x0p+0f,
+	0x0p+0f,
+	0x0p+0f,
+	0x8p-152f,
+	true,
+	0x4p-152,
+	0x4p-152,
+	0x4p-152,
+	0x4p-152,
+	true,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	true,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	true,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	true,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	true,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L,
+	0x4p-152L),
+  TEST ("0x1p-1075",
+	false,
+	0x0p+0f,
+	0x0p+0f,
+	0x0p+0f,
+	0x8p-152f,
+	false,
+	0x0p+0,
+	0x0p+0,
+	0x0p+0,
+	0x4p-1076,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-1076L,
+	true,
+	0x2p-1076L,
+	0x2p-1076L,
+	0x2p-1076L,
+	0x2p-1076L,
+	true,
+	0x2p-1076L,
+	0x2p-1076L,
+	0x2p-1076L,
+	0x2p-1076L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-1076L,
+	true,
+	0x2p-1076L,
+	0x2p-1076L,
+	0x2p-1076L,
+	0x2p-1076L),
+  TEST ("0x1p-16446",
+	false,
+	0x0p+0f,
+	0x0p+0f,
+	0x0p+0f,
+	0x8p-152f,
+	false,
+	0x0p+0,
+	0x0p+0,
+	0x0p+0,
+	0x4p-1076,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-1076L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x8p-16448L,
+	true,
+	0x4p-16448L,
+	0x4p-16448L,
+	0x4p-16448L,
+	0x4p-16448L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-1076L,
+	true,
+	0x4p-16448L,
+	0x4p-16448L,
+	0x4p-16448L,
+	0x4p-16448L),
+  TEST ("0x1p-16495",
+	false,
+	0x0p+0f,
+	0x0p+0f,
+	0x0p+0f,
+	0x8p-152f,
+	false,
+	0x0p+0,
+	0x0p+0,
+	0x0p+0,
+	0x4p-1076,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-1076L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x8p-16448L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-16448L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-1076L,
+	false,
+	0x0p+0L,
+	0x0p+0L,
+	0x0p+0L,
+	0x4p-16496L),
+  TEST ("-0x1p-150",
+	false,
+	-0x8p-152f,
+	-0x0p+0f,
+	-0x0p+0f,
+	-0x0p+0f,
+	true,
+	-0x4p-152,
+	-0x4p-152,
+	-0x4p-152,
+	-0x4p-152,
+	true,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	true,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	true,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	true,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	true,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L,
+	-0x4p-152L),
+  TEST ("-0x1p-1075",
+	false,
+	-0x8p-152f,
+	-0x0p+0f,
+	-0x0p+0f,
+	-0x0p+0f,
+	false,
+	-0x4p-1076,
+	-0x0p+0,
+	-0x0p+0,
+	-0x0p+0,
+	false,
+	-0x4p-1076L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	true,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	true,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	false,
+	-0x4p-1076L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	true,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	-0x2p-1076L,
+	-0x2p-1076L),
+  TEST ("-0x1p-16446",
+	false,
+	-0x8p-152f,
+	-0x0p+0f,
+	-0x0p+0f,
+	-0x0p+0f,
+	false,
+	-0x4p-1076,
+	-0x0p+0,
+	-0x0p+0,
+	-0x0p+0,
+	false,
+	-0x4p-1076L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	false,
+	-0x8p-16448L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	true,
+	-0x4p-16448L,
+	-0x4p-16448L,
+	-0x4p-16448L,
+	-0x4p-16448L,
+	false,
+	-0x4p-1076L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	true,
+	-0x4p-16448L,
+	-0x4p-16448L,
+	-0x4p-16448L,
+	-0x4p-16448L),
+  TEST ("-0x1p-16495",
+	false,
+	-0x8p-152f,
+	-0x0p+0f,
+	-0x0p+0f,
+	-0x0p+0f,
+	false,
+	-0x4p-1076,
+	-0x0p+0,
+	-0x0p+0,
+	-0x0p+0,
+	false,
+	-0x4p-1076L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	false,
+	-0x8p-16448L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	false,
+	-0x4p-16448L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	false,
+	-0x4p-1076L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L,
+	false,
+	-0x4p-16496L,
+	-0x0p+0L,
+	-0x0p+0L,
+	-0x0p+0L),
 };
 
 static int