Skip to content

Commit a7feb3b

Browse files
committed
Formatting fixes
1 parent 2aec68e commit a7feb3b

File tree

6 files changed

+30
-60
lines changed

6 files changed

+30
-60
lines changed

src/Functions/byteSwap.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ One use case of this function is reversing IPv4s:
8282
FunctionDocumentation::Argument argument1 = {"x", "An integer value."};
8383
FunctionDocumentation::Arguments arguments = {argument1};
8484
FunctionDocumentation::ReturnedValue returned_value = "x with bytes reversed";
85-
FunctionDocumentation::Example example1 = {"", "byteSwap(3351772109)", R"(
86-
┌─byteSwap(3351772109)─┐
87-
│ 3455829959 │
88-
└──────────────────────┘
89-
)"};
85+
FunctionDocumentation::Example example1 = {"", "SELECT byteSwap(3351772109)", "3455829959"};
9086
FunctionDocumentation::Example example2 = {"8-bit", "SELECT byteSwap(54)", "54"};
9187
FunctionDocumentation::Example example3 = {"16-bit", "SELECT byteSwap(4135)", "10000"};
9288
FunctionDocumentation::Example example4 = {"32-bit", "SELECT byteSwap(3351772109)", "3455829959"};

src/Functions/divideDecimal.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,37 @@ struct DivideDecimalsImpl
6060
REGISTER_FUNCTION(DivideDecimals)
6161
{
6262
FunctionDocumentation::Description description = R"(
63-
Performs division on two decimals. Result value will be of type [Decimal256](/sql-reference/data-types/decimal).
64-
Result scale can be explicitly specified by `result_scale` argument (const Integer in range `[0, 76]`). If not specified, the result scale is the max scale of given arguments.
63+
Performs division on two decimals. Result value will be of type [Decimal256](/sql-reference/data-types/decimal).
64+
Result scale can be explicitly specified by `result_scale` argument (const Integer in range `[0, 76]`). If not specified, the result scale is the max scale of given arguments.
6565
66-
:::note
67-
These function work significantly slower than usual `divide`.
68-
In case you don't really need controlled precision and/or need fast computation, consider using [divide](#divide).
69-
:::
66+
:::note
67+
These function work significantly slower than usual `divide`.
68+
In case you don't really need controlled precision and/or need fast computation, consider using [divide](#divide).
69+
:::
7070
)";
71-
FunctionDocumentation::Syntax syntax = "divideDecimal(a, b[, result_scale])";
72-
FunctionDocumentation::Argument argument1 = {"a", "First value: [Decimal](/sql-reference/data-types/decimal)."};
73-
FunctionDocumentation::Argument argument2 = {"b", "Second value: [Decimal](/sql-reference/data-types/decimal)."};
71+
FunctionDocumentation::Syntax syntax = "divideDecimal(x, y[, result_scale])";
72+
FunctionDocumentation::Argument argument1 = {"x", "First value: [Decimal](/sql-reference/data-types/decimal)."};
73+
FunctionDocumentation::Argument argument2 = {"y", "Second value: [Decimal](/sql-reference/data-types/decimal)."};
7474
FunctionDocumentation::Argument argument3 = {"result_scale", "Scale of result. Type [Int/UInt](/sql-reference/data-types/int-uint)."};
7575
FunctionDocumentation::Arguments arguments = {argument1, argument2, argument3};
7676
FunctionDocumentation::ReturnedValue returned_value = "The result of division with given scale. Type: [Decimal256](/sql-reference/data-types/decimal.md).";
7777
FunctionDocumentation::Example example1 = {"", "divideDecimal(toDecimal256(-12, 0), toDecimal32(2.1, 1), 10)", R"(
78-
┌─divideDecimal(toDecimal256(-12, 0), toDecimal32(2.1, 1), 10)─┐
79-
│ -5.7142857142 │
80-
└──────────────────────────────────────────────────────────────┘
78+
┌─divideDecimal(toDecimal256(-12, 0), toDecimal32(2.1, 1), 10)─┐
79+
│ -5.7142857142 │
80+
└──────────────────────────────────────────────────────────────┘
8181
)"};
8282
FunctionDocumentation::Example example2 = {"",
8383
R"(
84-
SELECT toDecimal64(-12, 1) / toDecimal32(2.1, 1);
85-
SELECT toDecimal64(-12, 1) as a, toDecimal32(2.1, 1) as b, divideDecimal(a, b, 1), divideDecimal(a, b, 5);
84+
SELECT toDecimal64(-12, 1) / toDecimal32(2.1, 1);
85+
SELECT toDecimal64(-12, 1) as a, toDecimal32(2.1, 1) as b, divideDecimal(a, b, 1), divideDecimal(a, b, 5);
8686
)",
8787
R"(
88-
┌─divide(toDecimal64(-12, 1), toDecimal32(2.1, 1))─┐
89-
│ -5.7 │
90-
└──────────────────────────────────────────────────┘
91-
┌───a─┬───b─┬─divideDecimal(toDecimal64(-12, 1), toDecimal32(2.1, 1), 1)─┬─divideDecimal(toDecimal64(-12, 1), toDecimal32(2.1, 1), 5)─┐
92-
│ -12 │ 2.1 │ -5.7 │ -5.71428 │
93-
└─────┴─────┴────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────┘
88+
┌─divide(toDecimal64(-12, 1), toDecimal32(2.1, 1))─┐
89+
│ -5.7 │
90+
└──────────────────────────────────────────────────┘
91+
┌───a─┬───b─┬─divideDecimal(toDecimal64(-12, 1), toDecimal32(2.1, 1), 1)─┬─divideDecimal(toDecimal64(-12, 1), toDecimal32(2.1, 1), 5)─┐
92+
│ -12 │ 2.1 │ -5.7 │ -5.71428 │
93+
└─────┴─────┴────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────┘
9494
)"};
9595
FunctionDocumentation::Examples examples = {example1, example2};
9696
FunctionDocumentation::Category categories = FunctionDocumentation::Category::Arithmetic;

src/Functions/ifNotFinite.cpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,7 @@ You can get a similar result by using the [ternary operator](/sql-reference/func
7979
- `x` if `x` is finite.
8080
- `y` if `x` is not finite.
8181
)";
82-
FunctionDocumentation::Examples examples = {
83-
{
84-
"",
85-
R"(
86-
SELECT 1/0 AS infimum,
87-
ifNotFinite(infimum,42)
88-
)",
89-
"inf 42"
90-
}};
82+
FunctionDocumentation::Examples examples = {{"","SELECT 1/0 AS infimum, ifNotFinite(infimum,42)","inf 42"}};
9183
FunctionDocumentation::Category categories = FunctionDocumentation::Category::Arithmetic;
9284
FunctionDocumentation documentation = {description, syntax, arguments, returned_value, examples, categories};
9385

src/Functions/intDiv.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,20 @@ using FunctionIntDiv = BinaryArithmeticOverloadResolver<DivideIntegralImpl, Name
124124
REGISTER_FUNCTION(IntDiv)
125125
{
126126
FunctionDocumentation::Description description = R"(
127-
Performs an integer division of two values `a` by `b`. In other words it
127+
Performs an integer division of two values `x` by `y`. In other words it
128128
computes the quotient rounded down to the next smallest integer.
129129
130130
The result has the same width as the dividend (the first parameter).
131131
132132
An exception is thrown when dividing by zero, when the quotient does not fit
133133
in the range of the dividend, or when dividing a minimal negative number by minus one.
134134
)";
135-
FunctionDocumentation::Syntax syntax = "intDiv(a, b)";
136-
FunctionDocumentation::Argument argument1 = {"a", "Left hand operand."};
137-
FunctionDocumentation::Argument argument2 = {"b", "Right hand operand."};
135+
FunctionDocumentation::Syntax syntax = "intDiv(x, y)";
136+
FunctionDocumentation::Argument argument1 = {"x", "Left hand operand."};
137+
FunctionDocumentation::Argument argument2 = {"y", "Right hand operand."};
138138
FunctionDocumentation::Arguments arguments = {argument1, argument2};
139-
FunctionDocumentation::ReturnedValue returned_value = "Result of integer division of a and b";
140-
FunctionDocumentation::Example example1 = {"Integer division of two floats", R"(
141-
SELECT
142-
intDiv(toFloat64(1), 0.001) AS res,
143-
toTypeName(res)
144-
)", R"(
139+
FunctionDocumentation::ReturnedValue returned_value = "Result of integer division of `x` and `y`";
140+
FunctionDocumentation::Example example1 = {"Integer division of two floats", "SELECT intDiv(toFloat64(1), 0.001) AS res, toTypeName(res)", R"(
145141
┌──res─┬─toTypeName(intDiv(toFloat64(1), 0.001))─┐
146142
│ 1000 │ Int64 │
147143
└──────┴─────────────────────────────────────────┘

src/Functions/isFinite.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@ otherwise this function returns `0`.
4848
FunctionDocumentation::Argument argument1 = {"x", "Number to check for finiteness. Float32 or Float64."};
4949
FunctionDocumentation::Arguments arguments = {argument1};
5050
FunctionDocumentation::ReturnedValue returned_value = "`1` if x is not infinite and not `NaN`, otherwise `0`.";
51-
FunctionDocumentation::Examples examples = {{
52-
"Test if a number is finite",
53-
"SELECT isFinite(inf)",
54-
"0"
55-
}};
51+
FunctionDocumentation::Examples examples = {{"Test if a number is finite", "SELECT isFinite(inf)", "0"}};
5652
FunctionDocumentation::Category categories = FunctionDocumentation::Category::Arithmetic;
5753
FunctionDocumentation documentation = {description, syntax, arguments, returned_value, examples, categories};
5854

src/Functions/isInfinite.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,7 @@ REGISTER_FUNCTION(IsInfinite)
4444
FunctionDocumentation::Argument argument1 = {"x", "Number to check for infiniteness. Float32 or Float64."};
4545
FunctionDocumentation::Arguments arguments = {argument1};
4646
FunctionDocumentation::ReturnedValue returned_value = "`1` if x is infinite, otherwise `0` (including for `NaN`).";
47-
FunctionDocumentation::Examples examples = {
48-
{
49-
"Test if a number is infinite",
50-
R"(
51-
SELECT
52-
isInfinite(inf),
53-
isInfinite(NaN),
54-
isInfinite(10)
55-
)",
56-
"1 0 0"
57-
}
47+
FunctionDocumentation::Examples examples = {{"Test if a number is infinite", "SELECT isInfinite(inf), isInfinite(NaN), isInfinite(10))", "1 0 0"}
5848
};
5949
FunctionDocumentation::Category categories = FunctionDocumentation::Category::Arithmetic;
6050
FunctionDocumentation documentation = {description, syntax, arguments, returned_value, examples, categories};

0 commit comments

Comments
 (0)