mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 09:02:00 +00:00
Add test
This commit is contained in:
parent
8392b35d50
commit
e3fc7662c1
19
tests/queries/0_stateless/02560_count_digits.reference
Normal file
19
tests/queries/0_stateless/02560_count_digits.reference
Normal file
@ -0,0 +1,19 @@
|
||||
1
|
||||
1
|
||||
1
|
||||
5
|
||||
5
|
||||
20
|
||||
19
|
||||
39
|
||||
78
|
||||
39
|
||||
77
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
22
tests/queries/0_stateless/02560_count_digits.sql
Normal file
22
tests/queries/0_stateless/02560_count_digits.sql
Normal file
@ -0,0 +1,22 @@
|
||||
SELECT countDigits(0);
|
||||
SELECT countDigits(1);
|
||||
SELECT countDigits(-1);
|
||||
SELECT countDigits(12345);
|
||||
SELECT countDigits(-12345);
|
||||
SELECT countDigits(0xFFFFFFFFFFFFFFFF);
|
||||
SELECT countDigits(CAST(0x8000000000000000 AS Int64));
|
||||
SELECT countDigits(CAST(-1 AS UInt128));
|
||||
SELECT countDigits(CAST(-1 AS UInt256));
|
||||
SELECT countDigits(CAST(CAST(-1 AS UInt128) DIV 2 + 1 AS Int128));
|
||||
SELECT countDigits(CAST(CAST(-1 AS UInt256) DIV 2 + 1 AS Int256));
|
||||
|
||||
SELECT countDigits(-123.45678::Decimal32(5));
|
||||
SELECT countDigits(-123.456789::Decimal64(6));
|
||||
SELECT countDigits(-123.4567890::Decimal128(7));
|
||||
SELECT countDigits(-123.45678901::Decimal256(8));
|
||||
|
||||
-- this behavior can be surprising, but actually reasonable:
|
||||
SELECT countDigits(-123.456::Decimal32(5));
|
||||
SELECT countDigits(-123.4567::Decimal64(6));
|
||||
SELECT countDigits(-123.45678::Decimal128(7));
|
||||
SELECT countDigits(-123.456789::Decimal256(8));
|
Loading…
Reference in New Issue
Block a user