diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-05-03 13:10:31 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2007-05-03 13:10:31 +0000 |
commit | 273dbc77d3d971b52c4042a068f941003e3cf035 (patch) | |
tree | eff128b27562c8b0111aa7526dffdedf1624da06 /tests/tremquo.c | |
parent | e667b059fa43c7b251cbb30354712ae5dbfef184 (diff) | |
download | mpfr-273dbc77d3d971b52c4042a068f941003e3cf035.tar.gz |
added code to use tremquo with command-line arguments (tremquo x y)
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4431 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tremquo.c')
-rw-r--r-- | tests/tremquo.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/tremquo.c b/tests/tremquo.c index f31b9df39..96d7f3dad 100644 --- a/tests/tremquo.c +++ b/tests/tremquo.c @@ -31,6 +31,23 @@ main (int argc, char *argv[]) mpfr_t x, y, r; long q[1]; + if (argc == 3) /* usage: tremquo x y (rnd=GMP_RNDN implicit) */ + { + mpfr_init2 (x, 53); + mpfr_init2 (y, 53); + mpfr_init2 (r, 53); + mpfr_set_str (x, argv[1], 10, GMP_RNDN); + mpfr_set_str (y, argv[2], 10, GMP_RNDN); + mpfr_remquo (r, q, x, y, GMP_RNDN); + printf ("r="); + mpfr_out_str (stdout, 10, 0, r, GMP_RNDN); + printf (" q=%ld\n", q[0]); + mpfr_clear (x); + mpfr_clear (y); + mpfr_clear (r); + return 0; + } + tests_start_mpfr (); mpfr_init (x); |