mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
✅ add test for gcd and modulo functions
This commit is contained in:
parent
a665d4c723
commit
66bbc737d4
@ -8,6 +8,9 @@
|
|||||||
1
|
1
|
||||||
2147483647
|
2147483647
|
||||||
1
|
1
|
||||||
|
5
|
||||||
|
255
|
||||||
|
1
|
||||||
5120
|
5120
|
||||||
121
|
121
|
||||||
256
|
256
|
||||||
|
@ -9,6 +9,9 @@ select gcd(255, 254);
|
|||||||
select gcd(2147483647, 2147483646);
|
select gcd(2147483647, 2147483646);
|
||||||
select gcd(4611686011984936962, 2147483647);
|
select gcd(4611686011984936962, 2147483647);
|
||||||
select gcd(-2147483648, 1);
|
select gcd(-2147483648, 1);
|
||||||
|
select gcd(255, 515);
|
||||||
|
select gcd(255, 510);
|
||||||
|
select gcd(255, 512);
|
||||||
-- test lcm
|
-- test lcm
|
||||||
select lcm(1280, 1024);
|
select lcm(1280, 1024);
|
||||||
select lcm(11, 121);
|
select lcm(11, 121);
|
||||||
|
13
dbms/tests/queries/0_stateless/00516_modulo.reference
Normal file
13
dbms/tests/queries/0_stateless/00516_modulo.reference
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
8
|
||||||
|
1
|
||||||
|
255
|
||||||
|
255
|
||||||
|
255
|
||||||
|
0
|
||||||
|
127
|
||||||
|
0
|
||||||
|
-1
|
||||||
|
57
|
||||||
|
3
|
||||||
|
20
|
||||||
|
16
|
13
dbms/tests/queries/0_stateless/00516_modulo.sql
Normal file
13
dbms/tests/queries/0_stateless/00516_modulo.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
SELECT 1000 % 32;
|
||||||
|
SELECT 7 % 3;
|
||||||
|
SELECT 255 % 510;
|
||||||
|
SELECT 255 % 512;
|
||||||
|
SELECT 255 % 1000000009;
|
||||||
|
SELECT 0 % 255;
|
||||||
|
SELECT 2147483647 % 255;
|
||||||
|
SELECT -1 % -1;
|
||||||
|
SELECT -1 % -2;
|
||||||
|
SELECT 255 % 99;
|
||||||
|
SELECT 42 % 13;
|
||||||
|
SELECT 42 % 22;
|
||||||
|
SELECT 1234567 % 123;
|
Loading…
Reference in New Issue
Block a user