| OLD | NEW |
| 1 # 2012 June 18 | 1 # 2012 June 18 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| 11 # | 11 # |
| 12 # Tests of the sqlite3AtoF() function. | 12 # Tests of the sqlite3AtoF() function. |
| 13 # | 13 # |
| 14 | 14 |
| 15 set testdir [file dirname $argv0] | 15 set testdir [file dirname $argv0] |
| 16 source $testdir/tester.tcl | 16 source $testdir/tester.tcl |
| 17 | 17 |
| 18 if {![info exists __GNUC__] || [regexp arm $tcl_platform(machine)]} { | 18 if {$::longdouble_size<=8} { |
| 19 finish_test | 19 finish_test |
| 20 return | 20 return |
| 21 } | 21 } |
| 22 | 22 |
| 23 expr srand(1) | 23 expr srand(1) |
| 24 for {set i 1} {$i<20000} {incr i} { | 24 for {set i 1} {$i<20000} {incr i} { |
| 25 set pow [expr {int((rand()-0.5)*100)}] | 25 set pow [expr {int((rand()-0.5)*100)}] |
| 26 set x [expr {pow((rand()-0.5)*2*rand(),$pow)}] | 26 set x [expr {pow((rand()-0.5)*2*rand(),$pow)}] |
| 27 set xf [format %.32e $x] | 27 set xf [format %.32e $x] |
| 28 | 28 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 51 puts [format {QUOTE: %16s %s} {} [db eval {SELECT quote($x)}]] | 51 puts [format {QUOTE: %16s %s} {} [db eval {SELECT quote($x)}]] |
| 52 db eval {SELECT CAST(quote($x) AS real) c} {} | 52 db eval {SELECT CAST(quote($x) AS real) c} {} |
| 53 puts "OUT: $b [format %.32e $c]" | 53 puts "OUT: $b [format %.32e $c]" |
| 54 } | 54 } |
| 55 set y | 55 set y |
| 56 } {1} | 56 } {1} |
| 57 } | 57 } |
| 58 | 58 |
| 59 | 59 |
| 60 finish_test | 60 finish_test |
| OLD | NEW |