drh | f6e904b | 2020-12-07 17:15:32 +0000 | [diff] [blame^] | 1 | # 2020-12-07 |
| 2 | # |
| 3 | # The author disclaims copyright to this source code. In place of |
| 4 | # a legal notice, here is a blessing: |
| 5 | # |
| 6 | # May you do good and not evil. |
| 7 | # May you find forgiveness for yourself and forgive others. |
| 8 | # May you share freely, never taking more than you give. |
| 9 | # |
| 10 | #************************************************************************* |
| 11 | # |
| 12 | # Test cases for SQL functions based off the standard math library |
| 13 | # |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | ifcapable !mathlib { |
| 17 | finish_test |
| 18 | return |
| 19 | } |
| 20 | |
| 21 | do_execsql_test func7-100 { |
| 22 | SELECT ceil(99.9), ceiling(-99.01), floor(17), floor(-17.99); |
| 23 | } {100.0 -99.0 17 -18.0} |
| 24 | do_execsql_test func7-110 { |
| 25 | SELECT quote(ceil(NULL)), ceil('-99.99'); |
| 26 | } {NULL -99.0} |
| 27 | do_execsql_test func7-200 { |
| 28 | SELECT round(ln(5),2), log(100.0), log(100), log('256',2); |
| 29 | } {1.61 2.0 2.0 8.0} |
| 30 | do_execsql_test func7-210 { |
| 31 | SELECT ln(-5), log(100.0,-5); |
| 32 | } {{} {}} |
| 33 | |
| 34 | |
| 35 | finish_test |