/ Check-in [dd69e53c]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Further simplifications to sqlite3AtoF() to remove unneeded branches.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: dd69e53cb077873171af5312c633ca185595bf31
User & Date: drh 2016-04-26 23:14:45
Context
2016-04-27
02:35
Remove still more unnecessary branches from sqlite3AtoF(). check-in: 3adfe9f3 user: drh tags: trunk
2016-04-26
23:14
Further simplifications to sqlite3AtoF() to remove unneeded branches. check-in: dd69e53c user: drh tags: trunk
21:02
Remove an unnecessary line from the sqlite3AtoF() routine. check-in: a9d00749 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

396
397
398
399
400
401
402
403

404


405
406
407
408
409
410
411
412
413
414
415
  if( z>=zEnd ) goto do_atof_calc;

  /* if decimal point is present */
  if( *z=='.' ){
    z+=incr;
    /* copy digits from after decimal to significand
    ** (decrease exponent by d to shift decimal right) */
    while( z<zEnd && sqlite3Isdigit(*z) && s<((LARGEST_INT64-9)/10) ){

      s = s*10 + (*z - '0');


      z+=incr, nDigits++, d--;
    }
    /* skip non-significant digits */
    while( z<zEnd && sqlite3Isdigit(*z) ) z+=incr, nDigits++;
  }
  if( z>=zEnd ) goto do_atof_calc;

  /* if exponent is present */
  if( *z=='e' || *z=='E' ){
    z+=incr;
    eValid = 0;







|
>
|
>
>
|

<
<







396
397
398
399
400
401
402
403
404
405
406
407
408
409


410
411
412
413
414
415
416
  if( z>=zEnd ) goto do_atof_calc;

  /* if decimal point is present */
  if( *z=='.' ){
    z+=incr;
    /* copy digits from after decimal to significand
    ** (decrease exponent by d to shift decimal right) */
    while( z<zEnd && sqlite3Isdigit(*z) ){
      if( s<((LARGEST_INT64-9)/10) ){
        s = s*10 + (*z - '0');
        d--;
      }
      z+=incr, nDigits++;
    }


  }
  if( z>=zEnd ) goto do_atof_calc;

  /* if exponent is present */
  if( *z=='e' || *z=='E' ){
    z+=incr;
    eValid = 0;