diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-10-12 12:24:18 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-10-12 12:24:18 +0000 |
commit | 7fb33e1b653edb976054e0bb98bbf3c821935e74 (patch) | |
tree | bf22b8314bb0bde53d2a965a96dc8d3746bf98dc /tests/tset_f.c | |
parent | 94e32b348835760bc9c7ff0e4ba1b41223426c10 (diff) | |
download | mpfr-7fb33e1b653edb976054e0bb98bbf3c821935e74.tar.gz |
added test for mpfr_init_set_f prototype
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1243 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tset_f.c')
-rw-r--r-- | tests/tset_f.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/tset_f.c b/tests/tset_f.c index ea0106c7c..12f5a13dd 100644 --- a/tests/tset_f.c +++ b/tests/tset_f.c @@ -25,28 +25,30 @@ MA 02111-1307, USA. */ #include "mpfr.h" #include "time.h" -#if defined(hpux) -#define srandom srand48 -#endif - int main (void) { - mpfr_t x, u; mpf_t y, z; unsigned long k, pr; + mpfr_t x, u; + mpf_t y, z; + unsigned long k, pr; - mpfr_init2(x, 100); mpf_init(y); mpf_init(z); - mpf_set_d(y, 0.0); - mpfr_set_f(x, y, GMP_RNDN); + mpf_set_d (y, 0.0); + + /* check prototype of mpfr_init_set_f */ + mpfr_init_set_f (x, y, GMP_RNDN); + mpfr_set_prec (x, 100); + mpfr_set_f (x, y, GMP_RNDN); srandom((int)time(NULL)); mpf_random2(y, 10, 0); mpfr_set_f(x, y, rand() & 3); /* bug found by Jean-Pierre Merlet */ - mpfr_set_prec(x, 256); mpf_set_prec(y, 256); + mpfr_set_prec(x, 256); + mpf_set_prec(y, 256); mpfr_init2(u, 256); mpfr_set_str(u, "7.f10872b020c49ba5e353f7ced916872b020c49ba5e353f7ced916872b020c498@2", |