summaryrefslogtreecommitdiff
path: root/tests/tprintf.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-04 14:00:08 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2018-07-04 14:00:08 +0000
commit22d4a02fd3f087ac88517dbf5d9a6d98e919fc0d (patch)
treefa16636f53fc2ff17f3ec42cd184c6556a7323b9 /tests/tprintf.c
parent1234c0541091aafc8e97ec37462f80a37fb55205 (diff)
downloadmpfr-22d4a02fd3f087ac88517dbf5d9a6d98e919fc0d.tar.gz
[tests/tprintf.c] Added more tests of the form 10^i - 1/2.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12882 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tprintf.c')
-rw-r--r--tests/tprintf.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/tprintf.c b/tests/tprintf.c
index babacdd70..b6e7efb53 100644
--- a/tests/tprintf.c
+++ b/tests/tprintf.c
@@ -492,6 +492,7 @@ test_locale (void)
int i;
mpfr_t x;
int count;
+ char v[] = "99999999999999999999999.5";
for (i = 0; i < numberof(tab_locale); i++)
{
@@ -525,17 +526,12 @@ test_locale (void)
count = mpfr_printf ("(3) 1000=%'Rf \n", x);
check_length (10002, count, 23, d);
- mpfr_set_str (x, "9.5", 10, MPFR_RNDN);
- count = mpfr_printf ("(4) 10=%'.0Rf \n", x);
- check_length (10003, count, 11, d);
-
- mpfr_set_str (x, "99.5", 10, MPFR_RNDN);
- count = mpfr_printf ("(5) 100=%'.0Rf \n", x);
- check_length (10004, count, 13, d);
-
- mpfr_set_str (x, "999.5", 10, MPFR_RNDN);
- count = mpfr_printf ("(6) 1000=%'.0Rf \n", x);
- check_length (10005, count, 16, d);
+ for (i = 1; i <= sizeof (v) - 3; i++)
+ {
+ mpfr_set_str (x, v + sizeof (v) - 3 - i, 10, MPFR_RNDN);
+ count = mpfr_printf ("(4) 10^i=%'.0Rf \n", x);
+ check_length (10002 + i, count, 12 + i + i/3, d);
+ }
mpfr_clear (x);
}