SQLite

Check-in [59bb999c8b]
Login

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

Overview
Comment:Performance improvement for ascii to floating-point conversions with very large exponents.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 59bb999c8ba5e4ee7a4e388fc724b8606136d60c
User & Date: drh 2011-10-17 12:14:26.646
Context
2011-10-17
20:41
Avoid 32-bit integer overflow when evaluating the exponent of a floating point value during ascii to binary conversion. (check-in: 4becc47eb4 user: drh tags: trunk)
12:14
Performance improvement for ascii to floating-point conversions with very large exponents. (check-in: 59bb999c8b user: drh tags: trunk)
2011-10-15
00:16
Added the tool/warnings-clang.sh script. Changes so that there are no warnings with either gcc or clang even including FTS4 and RTREE and both with and without SQLITE_THREADSAFE=0. (check-in: 39408702a9 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/util.c.
378
379
380
381
382
383
384






385
386
387
388
389
390
391
        if( esign<0 ){
          result = s / scale;
          result /= 1.0e+308;
        }else{
          result = s * scale;
          result *= 1.0e+308;
        }






      }else{
        /* 1.0e+22 is the largest power of 10 than can be 
        ** represented exactly. */
        while( e%22 ) { scale *= 1.0e+1; e -= 1; }
        while( e>0 ) { scale *= 1.0e+22; e -= 22; }
        if( esign<0 ){
          result = s / scale;







>
>
>
>
>
>







378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
        if( esign<0 ){
          result = s / scale;
          result /= 1.0e+308;
        }else{
          result = s * scale;
          result *= 1.0e+308;
        }
      }else if( e>=342 ){
        if( esign<0 ){
          result = 0.0*s;
        }else{
          result = 1e308*1e308*s;  /* Infinity */
        }
      }else{
        /* 1.0e+22 is the largest power of 10 than can be 
        ** represented exactly. */
        while( e%22 ) { scale *= 1.0e+1; e -= 1; }
        while( e>0 ) { scale *= 1.0e+22; e -= 22; }
        if( esign<0 ){
          result = s / scale;