diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-05-24 19:02:07 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-05-24 19:02:07 +0000 |
commit | b51587f9e1ed3ae2499c8567cbc9ecf67e146e2c (patch) | |
tree | fa150d10827837bb391438351f680f790bd6a104 /tests | |
parent | d89cd8cbd7a332f0fa34c59333347e805b9a633f (diff) | |
download | mpfr-b51587f9e1ed3ae2499c8567cbc9ecf67e146e2c.tar.gz |
minor changes to allow ./tlog xxx prec
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10360 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tlog.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/tlog.c b/tests/tlog.c index fc1e3fba9..21d2933c6 100644 --- a/tests/tlog.c +++ b/tests/tlog.c @@ -67,18 +67,16 @@ check2 (const char *as, mpfr_rnd_t rnd_mode, const char *res1s) } static void -check3 (double d, unsigned long prec, mpfr_rnd_t rnd) +check3 (char *s, unsigned long prec, mpfr_rnd_t rnd) { mpfr_t x, y; mpfr_init2 (x, prec); mpfr_init2 (y, prec); - mpfr_set_d (x, d, rnd); + mpfr_set_str (x, s, 10, rnd); test_log (y, x, rnd); mpfr_out_str (stdout, 10, 0, y, rnd); puts (""); - mpfr_print_binary (y); - puts (""); mpfr_clear (x); mpfr_clear (y); } @@ -274,9 +272,10 @@ main (int argc, char *argv[]) { tests_start_mpfr (); - if (argc==4) + if (argc == 3 || argc == 4) { /* tlog x prec rnd */ - check3 (atof(argv[1]), atoi(argv[2]), (mpfr_rnd_t) atoi(argv[3])); + check3 (argv[1], strtoul (argv[2], NULL, 10), + (argc == 4) ? atoi (argv[3]) : MPFR_RNDN); goto done; } |