summaryrefslogtreecommitdiff
path: root/set_str_raw.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-10-31 23:12:41 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-10-31 23:12:41 +0000
commit03a2ec93fe1d6d3e79f6e32786cd471929952327 (patch)
tree5d5cf298e9522b47bae9982013197eb94f20a018 /set_str_raw.c
parent3fdbec6c1121077adbe4fbc0d87021fee954714a (diff)
downloadmpfr-03a2ec93fe1d6d3e79f6e32786cd471929952327.tar.gz
fixed MLK for Inf or Nan
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1448 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_str_raw.c')
-rw-r--r--set_str_raw.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/set_str_raw.c b/set_str_raw.c
index cb9350da2..ac6a980db 100644
--- a/set_str_raw.c
+++ b/set_str_raw.c
@@ -48,7 +48,6 @@ mpfr_set_str_raw (x, str)
xp = MPFR_MANT(x);
xsize = 1 + (MPFR_PREC(x)-1)/BITS_PER_MP_LIMB;
alloc = (strlen(str)+1) * sizeof(char);
- str0 = str2 = (char *) (*__gmp_allocate_func) (alloc);
if (*str == '-') { negative = 1; str++; }
else if (*str == '+') str++;
@@ -56,7 +55,8 @@ mpfr_set_str_raw (x, str)
if (*str == 'I')
{
MPFR_SET_INF(x);
- if (MPFR_ISNEG(x) != negative) MPFR_CHANGE_SIGN(x);
+ if (MPFR_ISNEG(x) != negative)
+ MPFR_CHANGE_SIGN(x);
return;
}
@@ -68,6 +68,8 @@ mpfr_set_str_raw (x, str)
MPFR_CLEAR_FLAGS(x);
+ str0 = str2 = (char *) (*__gmp_allocate_func) (alloc);
+
while (*str == '0') { str++; }
while (*str == '0' || *str == '1')