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

Overview
Comment:Fixed flagging infinity as a real (instead of an integer) in sqlite4_num_from_text
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 73b8f01f49e99405fd13f758600604ed60553f85
User & Date: peterreid 2013-10-24 23:59:41.428
Context
2013-10-25
00:33
Add tests for prefix-only and ignore-whitespace flags of sqlite4_num_from_text check-in: 19f7a96631 user: peterreid tags: trunk
2013-10-24
23:59
Fixed flagging infinity as a real (instead of an integer) in sqlite4_num_from_text check-in: 73b8f01f49 user: peterreid tags: trunk
23:54
Add tests for the pbReal output of sqlite4_num_from_text check-in: fd1c1a7d4f user: peterreid tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/math.c.
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
   && (nIn-i)>=incr*3
   && ((c=zIn[i])=='i' || c=='I')
   && ((c=zIn[i+incr])=='n' || c=='N')
   && ((c=zIn[i+incr*2])=='f' || c=='F')
  ){
    r.e = SQLITE4_MX_EXP+1;
    r.m = 1;
    if( pbReal ) *pbReal = 1;
    i += incr*3;
    goto finished;
  }

  for( ; i<nIn && (c = zIn[i])!=0; i+=incr){
    if( c>='0' && c<='9' ){
      int iDigit = (c - '0');







|







375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
   && (nIn-i)>=incr*3
   && ((c=zIn[i])=='i' || c=='I')
   && ((c=zIn[i+incr])=='n' || c=='N')
   && ((c=zIn[i+incr*2])=='f' || c=='F')
  ){
    r.e = SQLITE4_MX_EXP+1;
    r.m = 1;
    bReal = 1;
    i += incr*3;
    goto finished;
  }

  for( ; i<nIn && (c = zIn[i])!=0; i+=incr){
    if( c>='0' && c<='9' ){
      int iDigit = (c - '0');
Changes to test/num.test.
239
240
241
242
243
244
245

246
247
248
249
250
251
252
} {
  do_test num-11.1.$tn { sqlite4_num_to_int32 $in } [list {*}$out]
}

foreach {tn in real} {
  0     4              false
  1     -84.63         true

} {
  do_test num-12.1-$tn { sqlite4_num_text_is_real $in } $real
}


#-------------------------------------------------------------------------
finish_test







>







239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
} {
  do_test num-11.1.$tn { sqlite4_num_to_int32 $in } [list {*}$out]
}

foreach {tn in real} {
  0     4              false
  1     -84.63         true
  2     -Inf           true
} {
  do_test num-12.1-$tn { sqlite4_num_text_is_real $in } $real
}


#-------------------------------------------------------------------------
finish_test