/* $OpenXM: OpenXM/src/mpfr/bfsize/bfsize.c,v 1.3 2016/06/14 07:24:21 takayama Exp $ */ #include #include "gmp.h" #include "gmp-impl.h" #include "mpfr.h" /* from mpfr-impl.h */ #define MPFR_PREC(x) ((x)->_mpfr_prec) #define MPFR_EXP(x) ((x)->_mpfr_exp) #define MPFR_MANT(x) ((x)->_mpfr_d) #define MPFR_LAST_LIMB(x) ((MPFR_PREC (x) - 1) / GMP_NUMB_BITS) #define MPFR_LIMB_SIZE(x) (MPFR_LAST_LIMB (x) + 1) int main(void) { mpfr_t x; int m,n,i; mpfr_init2(x,0xff); mpfr_set_d(x,3.14159,MPFR_RNDD); mpfr_out_str(stdout,2,0,x,MPFR_RNDD); printf("\n"); printf("Dump of mpfr_t x: "); n = sizeof(mpfr_t); m = sizeof(mp_limb_t); for (i=0; i