[BACK]Return to bfsize.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / mpfr / bfsize

Annotation of OpenXM/src/mpfr/bfsize/bfsize.c, Revision 1.2

1.2     ! takayama    1: /* $OpenXM$ */
1.1       takayama    2: #include <stdio.h>
                      3: #include "gmp.h"
                      4: #include "gmp-impl.h"
                      5: #include "mpfr.h"
                      6: 
                      7: int main(void) {
                      8:   mpfr_t x;
                      9:   int m,n,i;
                     10:   mpfr_init2(x,0xff);
                     11:   mpfr_set_d(x,3.14159,MPFR_RNDD);
                     12:   mpfr_out_str(stdout,2,0,x,MPFR_RNDD);
                     13:   printf("\n");
                     14:   printf("Dump of mpfr_t x: ");
                     15:   n = sizeof(mpfr_t);
                     16:   m = sizeof(mp_limb_t);
                     17:   for (i=0; i<n; i++) {
                     18:     if (i % m == 0) printf("|");
                     19:     printf("%02x ",((unsigned char *)(&x))[i]);
                     20:   }
                     21:   printf("\n");
                     22:   printf("sizeof(mpfr_t)=%d\n",(int) (sizeof(mpfr_t)));
                     23: 
                     24:   printf("sizeof(mp_limb_t)=%d\n",(int) (sizeof(mp_limb_t)));
                     25:   printf("sizeof(unsigned long)=%d\n",(int) (sizeof(unsigned long)));
                     26: 
                     27:   printf("GMP_NUMB_BITS=%d\n",GMP_NUMB_BITS);
                     28:   return(0);
                     29: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>