/ Check-in [3863638b]
Login

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

Overview
Comment:More rounding tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:3863638b8cd8d41cf4abf8b0d618892de845e91f
User & Date: shaneh 2010-02-17 03:57:59
Context
2010-02-17
04:19
Avoid using the internal printf routine for round(x,y) in the common case where y==0. check-in: d76ad8b3 user: shaneh tags: trunk
03:57
More rounding tests. check-in: 3863638b user: shaneh tags: trunk
2010-02-16
22:06
Remove duplicated assignment in realloc. check-in: c419955d user: shaneh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to test/func.test.

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254

255
256
257
258
259
260
261
    catchsql {SELECT round(b,2.0) FROM t1 ORDER BY b}
  } {0 {-2.0 1.23 2.0}}
  # Verify some values reported on the mailing list.
  # Some of these fail on MSVC builds with 64-bit
  # long doubles, but not on GCC builds with 80-bit
  # long doubles.
  for {set i 1} {$i<999} {incr i} {
    set x1 [expr 40222.0 + $i + 0.5]
    set x2 [expr 40223.0 + $i]
    do_test func-4.17.$i {
      execsql {SELECT round($x1);}
    } $x2
  }
  do_test func-4.18 {
    execsql {SELECT round(41051.5);}
  } {41052.0}
  do_test func-4.19 {
    execsql {SELECT round(41224.5);}
  } {41225.0}

  do_test func-4.20 {
    execsql {SELECT round(40223.4999999999);}
  } {40223.0}
  do_test func-4.21 {
    execsql {SELECT round(40224.4999999999);}
  } {40224.0}
  do_test func-4.22 {







|





|
|
|
|
|
|
>







236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
    catchsql {SELECT round(b,2.0) FROM t1 ORDER BY b}
  } {0 {-2.0 1.23 2.0}}
  # Verify some values reported on the mailing list.
  # Some of these fail on MSVC builds with 64-bit
  # long doubles, but not on GCC builds with 80-bit
  # long doubles.
  for {set i 1} {$i<999} {incr i} {
    set x1 [expr 40222.5 + $i]
    set x2 [expr 40223.0 + $i]
    do_test func-4.17.$i {
      execsql {SELECT round($x1);}
    } $x2
  }
  for {set i 1} {$i<999} {incr i} {
    set x1 [expr 40222.05 + $i]
    set x2 [expr 40222.10 + $i]
    do_test func-4.18.$i {
      execsql {SELECT round($x1,1);}
    } $x2
  }
  do_test func-4.20 {
    execsql {SELECT round(40223.4999999999);}
  } {40223.0}
  do_test func-4.21 {
    execsql {SELECT round(40224.4999999999);}
  } {40224.0}
  do_test func-4.22 {