mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
5db2d195a6
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union mysql-test/r/func_math.result: Auto merged mysql-test/t/func_math.test: Auto merged sql/item_func.cc: Auto merged
30 lines
1 KiB
Text
30 lines
1 KiB
Text
#
|
|
# Test of math functions
|
|
#
|
|
|
|
select floor(5.5),floor(-5.5);
|
|
select ceiling(5.5),ceiling(-5.5);
|
|
select truncate(52.64,1),truncate(52.64,2),truncate(52.64,-1),truncate(52.64,-2), truncate(-52.64,1),truncate(-52.64,-1);
|
|
select round(5.5),round(-5.5);
|
|
select round(5.64,1),round(5.64,2),round(5.64,-1),round(5.64,-2);
|
|
select abs(-10), sign(-5), sign(5), sign(0);
|
|
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
|
|
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
|
|
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
|
|
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
|
|
select pow(10,log10(10)),power(2,4);
|
|
set @@rand_seed1=10000000,@@rand_seed2=1000000;
|
|
select rand(999999),rand();
|
|
select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1);
|
|
select degrees(pi()),radians(360);
|
|
|
|
#
|
|
# Bug #2338 Trignometric arithmatic problems
|
|
#
|
|
|
|
SELECT ACOS(1.0);
|
|
SELECT ASIN(1.0);
|
|
SELECT ACOS(0.2*5.0);
|
|
SELECT ACOS(0.5*2.0);
|
|
SELECT ASIN(0.8+0.2);
|
|
SELECT ASIN(1.2-0.2);
|