xref: /sqlite-3.40.0/test/func7.test (revision f6e904bd)
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#
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16ifcapable !mathlib {
17  finish_test
18  return
19}
20
21do_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}
24do_execsql_test func7-110 {
25  SELECT quote(ceil(NULL)), ceil('-99.99');
26} {NULL -99.0}
27do_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}
30do_execsql_test func7-210 {
31  SELECT ln(-5), log(100.0,-5);
32} {{} {}}
33
34
35finish_test
36