diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-03-26 13:26:29 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2004-03-26 13:26:29 +0000 |
commit | 59944129ef3733a50e0628588027047c03646d8f (patch) | |
tree | 0c77478edb4a917b0f698e243000b01454da1296 | |
parent | 07c212c9a824cfe947077b93c0635f0822a7d2fb (diff) | |
download | mpfr-59944129ef3733a50e0628588027047c03646d8f.tar.gz |
Improve comments.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2857 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | init2.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -32,9 +32,11 @@ mpfr_init2 (mpfr_ptr x, mp_prec_t p) /* Check if we can represent the number of limbs * associated to the maximum of mpfr_prec_t*/ MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/BYTES_PER_MP_LIMB) ); + /* Check for correct BITS_PER_MP_LIMB and BYTES_PER_MP_LIMB */ MPFR_ASSERTN( BITS_PER_MP_LIMB == BYTES_PER_MP_LIMB * CHAR_BIT && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ); + /* Check for correct EXP NAN in both mpfr.h and in mpfr-impl.h */ MPFR_ASSERTN( __MPFR_EXP_NAN == MPFR_EXP_NAN ); @@ -46,11 +48,11 @@ mpfr_init2 (mpfr_ptr x, mp_prec_t p) xsize = (mp_size_t) ((p - 1) / BITS_PER_MP_LIMB) + 1; tmp = (mp_ptr) (*__gmp_allocate_func)(MPFR_MALLOC_SIZE(xsize)); - MPFR_PREC(x) = p; + MPFR_PREC(x) = p; /* Set prec */ MPFR_EXP (x) = MPFR_EXP_INVALID; /* make sure that the exp field has a valid value in the C point of view */ - MPFR_SET_POS(x); /* Set a sign */ - MPFR_SET_MANT_PTR(x, tmp); - MPFR_SET_ALLOC_SIZE(x, xsize); - MPFR_SET_NAN(x); /* initializes to NaN */ + MPFR_SET_POS(x); /* Set a sign */ + MPFR_SET_MANT_PTR(x, tmp); /* Set Mantissa ptr */ + MPFR_SET_ALLOC_SIZE(x, xsize); /* Fix alloc size of Mantissa */ + MPFR_SET_NAN(x); /* initializes to NaN */ } |