[BACK]Return to strtodg.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gdtoa

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libc/gdtoa/strtodg.c between version 1.7 and 1.8

version 1.7, 2011/03/20 23:15:35 version 1.8, 2011/03/21 12:53:50
Line 349  strtodg
Line 349  strtodg
         static int dplen;          static int dplen;
         if (!(s0 = decimalpoint_cache)) {          if (!(s0 = decimalpoint_cache)) {
                 s0 = localeconv()->decimal_point;                  s0 = localeconv()->decimal_point;
                 if ((decimalpoint_cache = MALLOC(strlen(s0) + 1))) {                  if ((decimalpoint_cache = MALLOC(strlen(s0) + 1)) != NULL) {
                         strcpy(decimalpoint_cache, s0);                          strcpy(decimalpoint_cache, s0);
                         s0 = decimalpoint_cache;                          s0 = decimalpoint_cache;
                         }                          }
Line 640  strtodg
Line 640  strtodg
                         e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias;                          e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias;
                         word0(&rv) &= ~Exp_mask;                          word0(&rv) &= ~Exp_mask;
                         word0(&rv) |= Bias << Exp_shift1;                          word0(&rv) |= Bias << Exp_shift1;
                         for(j = 0; e1 > 0; j++, e1 >>= 1)                          for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)
                                 if (e1 & 1)                                  if (e1 & 1)
                                         dval(&rv) *= bigtens[j];                                          dval(&rv) *= bigtens[j];
                         }                          }
Line 651  strtodg
Line 651  strtodg
                         dval(&rv) /= tens[i];                          dval(&rv) /= tens[i];
                 if (e1 &= ~15) {                  if (e1 &= ~15) {
                         e1 = (unsigned int)e1 >> 4;                          e1 = (unsigned int)e1 >> 4;
                         e1 >>= 4;  
                         while(e1 >= (1 << (n_bigtens-1))) {                          while(e1 >= (1 << (n_bigtens-1))) {
                                 e2 += ((word0(&rv) & Exp_mask)                                  e2 += ((word0(&rv) & Exp_mask)
                                         >> Exp_shift1) - Bias;                                          >> Exp_shift1) - Bias;
Line 663  strtodg
Line 662  strtodg
                         e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias;                          e2 += ((word0(&rv) & Exp_mask) >> Exp_shift1) - Bias;
                         word0(&rv) &= ~Exp_mask;                          word0(&rv) &= ~Exp_mask;
                         word0(&rv) |= Bias << Exp_shift1;                          word0(&rv) |= Bias << Exp_shift1;
                         for(j = 0; e1 > 0; j++, e1 >>= 1)                          for(j = 0; e1 > 0; j++, e1 = (unsigned int)e1 >> 1)
                                 if (e1 & 1)                                  if (e1 & 1)
                                         dval(&rv) *= tinytens[j];                                          dval(&rv) *= tinytens[j];
                         }                          }
Line 1073  strtodg
Line 1072  strtodg
                 irv = STRTOG_Normal | STRTOG_Inexlo;                  irv = STRTOG_Normal | STRTOG_Inexlo;
                 *expt = fpi->emax;                  *expt = fpi->emax;
                 b = bits;                  b = bits;
                 be = b + ((fpi->nbits + 31) >> 5);                  be = b + ((unsigned int)(fpi->nbits + 31) >> 5);
                 while(b < be)                  while(b < be)
                         *b++ = -1;                          *b++ = (unsigned int)-1;
                 if ((j = fpi->nbits & 0x1f))                  if ((j = fpi->nbits & 0x1f) != 0)
                         *--be >>= (32 - j);                          *--be >>= (32 - j);
                 goto ret;                  goto ret;
  huge:   huge:

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

CVSweb <webmaster@jp.NetBSD.org>