SQLite4
Check-in [97728c04e8]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix sqlite4_num_from_text in 0.000(many zeros)00123 case.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | num_work
Files: files | file ages | folders
SHA1: 97728c04e83970ff012265ee4b6f55012a0b2947
User & Date: peterreid 2013-02-09 05:35:20
Context
2013-02-09
05:36
Create sqlite4_num_isinf check-in: 555cdfbf52 user: peterreid tags: num_work
05:35
Fix sqlite4_num_from_text in 0.000(many zeros)00123 case. check-in: 97728c04e8 user: peterreid tags: num_work
05:33
Make sqlite4_num's exponent signed. check-in: b320c13e42 user: peterreid tags: num_work
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/math.c.

   338    338       r.e = SQLITE4_MX_EXP+1;
   339    339       r.m = nIn<=i+incr*3 || zIn[i+incr*3]==0;
   340    340       return r;
   341    341     }
   342    342     while( i<nIn && (c = zIn[i])!=0 ){
   343    343       i += incr;
   344    344       if( c>='0' && c<='9' ){
   345         -      if( c==0 && nDigit==0 ){
          345  +      if( c=='0' && nDigit==0 ){
   346    346           if( seenRadix && r.e > -(SQLITE4_MX_EXP+1000) ) r.e--;
   347    347           continue;
   348    348         }
   349    349         nDigit++;
   350    350         if( nDigit<=18 ){
   351    351           r.m = (r.m*10) + c - '0';
   352    352           if( seenRadix ) r.e--;