int main (void) { mpfr_t x, y, z, u; int inexact; mpfr_exp_t emax; tests_start_mpfr (); /* check prototypes of mpfr_init_set_* */ inexact = mpfr_init_set_si (x, -1, MPFR_RNDN); inexact = mpfr_init_set (y, x, MPFR_RNDN); inexact = mpfr_init_set_ui (z, 1, MPFR_RNDN); inexact = mpfr_init_set_d (u, 1.0, MPFR_RNDN); emax = mpfr_get_emax (); set_emax (0); mpfr_set_prec (x, 3); mpfr_set_str_binary (x, "0.111"); mpfr_set_prec (y, 2); mpfr_set (y, x, MPFR_RNDU); if (!(MPFR_IS_INF (y) && MPFR_SIGN (y) > 0)) { printf ("Error for y=x=0.111 with px=3, py=2 and emax=0\nx="); mpfr_dump (x); printf ("y="); mpfr_dump (y); exit (1); } set_emax (emax); mpfr_set_prec (y, 11); mpfr_set_str_binary (y, "0.11111111100E-8"); mpfr_set_prec (x, 2); mpfr_set (x, y, MPFR_RNDN); mpfr_set_str_binary (y, "1.0E-8"); if (mpfr_cmp (x, y)) { printf ("Error for y=0.11111111100E-8, prec=2, rnd=MPFR_RNDN\n"); exit (1); } mpfr_clear (x); mpfr_clear (y); mpfr_clear (z); mpfr_clear (u); check_ternary_value (); check_special (); check_neg_special (); test_generic (2, 1000, 10); tests_end_mpfr (); return 0; }
int main (void) { DECL_FUNC (CCU, f, mpc_add_ui); test_start (); check_ternary_value (); tgeneric (f, 2, 1024, 7, -1); test_end (); return 0; }
int main (void) { DECL_FUNC (CCF, f, mpc_add_fr); test_start (); check_ternary_value (1024, 1); data_check (f, "add_fr.dat"); tgeneric (f, 2, 1024, 7, 10); test_end (); return 0; }
int main (void) { test_start (); check_ternary_value (1024, 1); data_check_template ("add_fr.dsc", "add_fr.dat"); tgeneric_template ("add_fr.dsc", 2, 1024, 7, 128); test_end (); return 0; }
int main (void) { DECL_FUNC (C_CC, f, mpc_add); f.properties = FUNC_PROP_SYMETRIC; test_start (); check_ternary_value(); data_check (f, "add.dat"); tgeneric (f, 2, 1024, 7, -1); test_end (); return 0; }