1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Begin adding new SQL functions that depend on -lm: ceil(), ceiling(),

floor(), ln(), log(), and log10() so far.  More to follow.

FossilOrigin-Name: 4db5f2f7875f6df78630a7816fc018141a6eee2e295b44fc7627eb66d07881ea
This commit is contained in:
drh
2020-12-07 17:15:32 +00:00
parent aeb6bc5628
commit f6e904bd92
10 changed files with 249 additions and 27 deletions

35
test/func7.test Normal file
View File

@ -0,0 +1,35 @@
# 2020-12-07
#
# The author disclaims copyright to this source code. In place of
# a legal notice, here is a blessing:
#
# May you do good and not evil.
# May you find forgiveness for yourself and forgive others.
# May you share freely, never taking more than you give.
#
#*************************************************************************
#
# Test cases for SQL functions based off the standard math library
#
set testdir [file dirname $argv0]
source $testdir/tester.tcl
ifcapable !mathlib {
finish_test
return
}
do_execsql_test func7-100 {
SELECT ceil(99.9), ceiling(-99.01), floor(17), floor(-17.99);
} {100.0 -99.0 17 -18.0}
do_execsql_test func7-110 {
SELECT quote(ceil(NULL)), ceil('-99.99');
} {NULL -99.0}
do_execsql_test func7-200 {
SELECT round(ln(5),2), log(100.0), log(100), log('256',2);
} {1.61 2.0 2.0 8.0}
do_execsql_test func7-210 {
SELECT ln(-5), log(100.0,-5);
} {{} {}}
finish_test