/* Alloc a new mpfr_t on the main stack */ static mpfr_ptr new_inf (mpfr_prec_t p) { mpfr_ptr x = (mpfr_ptr) new_st (sizeof (mpfr_t)); void *mantissa = new_st ((mpfr_custom_get_size) (p)); (mpfr_custom_init) (mantissa, p); (mpfr_custom_init_set) (x, -MPFR_INF_KIND, 0, p, mantissa); return x; }
/* Alloc a new mpfr_t on the main stack */ static mpfr_ptr new_mpfr (mpfr_prec_t p) { mpfr_ptr x = (mpfr_ptr) new_st (sizeof (mpfr_t)); void *mantissa = new_st (mpfr_custom_get_size (p)); mpfr_custom_init (mantissa, p); mpfr_custom_init_set (x, 0, 0, p, mantissa); return x; }
/* a[0] is the kind, a[1] is the exponent, &a[2] is the mantissa */ static long * dummy_new (void) { long *r; r = (long *) new_st (ALIGNED (2 * sizeof (long)) + ALIGNED (mpfr_custom_get_size (p))); (mpfr_custom_init) (&r[2], p); r[0] = (int) MPFR_NAN_KIND; r[1] = 0; return r; }