diff options
author | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-10-27 15:15:04 +0000 |
---|---|---|
committer | pelissip <pelissip@280ebfd0-de03-0410-8827-d642c229c3f4> | 2003-10-27 15:15:04 +0000 |
commit | 734c0a144b04e2cae4e67b394010e3f6e3cadecc (patch) | |
tree | e0bb801e56a43c3aebe1ad73851ede3588e082fb /set_str_raw.c | |
parent | a7f45009dff2e3d0e8698b44e45f5cacacb82cdd (diff) | |
download | mpfr-734c0a144b04e2cae4e67b394010e3f6e3cadecc.tar.gz |
Change the internal format of MPFR: ZERO, INF and NAN have special values of exp.
Rename MPFR_ESIZE in MPFR_LIMB_SIZE.
Rename MPFR_ABSZISE in MPFR_ALLOC_SIZE.
Rename MPFR_INIT in MPFR_TMP_INIT (INIT1 too).
"mpfr.h" includes <gmp.h> if GMP isn't detected.
Change the way of detecting stdio.h (To check).
Use mpfr namespace for new definitions in "mpfr.h".
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2524 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_str_raw.c')
-rw-r--r-- | set_str_raw.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/set_str_raw.c b/set_str_raw.c index ecb724660..f367de663 100644 --- a/set_str_raw.c +++ b/set_str_raw.c @@ -42,7 +42,7 @@ mpfr_set_str_binary (mpfr_ptr x, const char *str) char *endstr2; xp = MPFR_MANT(x); - xsize = 1 + (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB; + xsize = MPFR_LIMB_SIZE(x); alloc = strlen(str) + 1; if (*str == '-') @@ -145,8 +145,10 @@ mpfr_set_str_binary (mpfr_ptr x, const char *str) mpn_lshift(xp, xp, xsize, cnt); MPFR_SET_EXP (x, expn - cnt); - if (MPFR_ISNEG(x) != negative) - MPFR_CHANGE_SIGN(x); + if (negative) + MPFR_SET_NEG(x); + else + MPFR_SET_POS(x); } (*__gmp_free_func) (str0, alloc); |