summaryrefslogtreecommitdiff
path: root/init2.c
diff options
context:
space:
mode:
authorpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-03-26 13:26:29 +0000
committerpelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4>2004-03-26 13:26:29 +0000
commit59944129ef3733a50e0628588027047c03646d8f (patch)
tree0c77478edb4a917b0f698e243000b01454da1296 /init2.c
parent07c212c9a824cfe947077b93c0635f0822a7d2fb (diff)
downloadmpfr-59944129ef3733a50e0628588027047c03646d8f.tar.gz
Improve comments.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2857 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'init2.c')
-rw-r--r--init2.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/init2.c b/init2.c
index 7bc854244..3c44e532c 100644
--- a/init2.c
+++ b/init2.c
@@ -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 */
}