duckdb 0.3.1-dev431.0 → 0.3.1-dev440.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +34 -0
- package/src/duckdb.hpp +2 -2
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -83840,6 +83840,10 @@ struct NextAfterFun {
|
|
|
83840
83840
|
static void RegisterFunction(BuiltinFunctions &set);
|
|
83841
83841
|
};
|
|
83842
83842
|
|
|
83843
|
+
struct EvenFun {
|
|
83844
|
+
static void RegisterFunction(BuiltinFunctions &set);
|
|
83845
|
+
};
|
|
83846
|
+
|
|
83843
83847
|
} // namespace duckdb
|
|
83844
83848
|
|
|
83845
83849
|
|
|
@@ -84801,6 +84805,34 @@ void FactorialFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
84801
84805
|
set.AddFunction({"factorial", "!__postfix"}, fun);
|
|
84802
84806
|
}
|
|
84803
84807
|
|
|
84808
|
+
//===--------------------------------------------------------------------===//
|
|
84809
|
+
// even
|
|
84810
|
+
//===--------------------------------------------------------------------===//
|
|
84811
|
+
struct EvenOperator {
|
|
84812
|
+
template <class TA, class TR>
|
|
84813
|
+
static inline TR Operation(TA left) {
|
|
84814
|
+
double value;
|
|
84815
|
+
if (left >= 0) {
|
|
84816
|
+
value = std::ceil(left);
|
|
84817
|
+
} else {
|
|
84818
|
+
value = std::ceil(-left);
|
|
84819
|
+
value = -value;
|
|
84820
|
+
}
|
|
84821
|
+
if (std::floor(value / 2) * 2 != value) {
|
|
84822
|
+
if (left >= 0) {
|
|
84823
|
+
return value += 1;
|
|
84824
|
+
}
|
|
84825
|
+
return value -= 1;
|
|
84826
|
+
}
|
|
84827
|
+
return value;
|
|
84828
|
+
}
|
|
84829
|
+
};
|
|
84830
|
+
|
|
84831
|
+
void EvenFun::RegisterFunction(BuiltinFunctions &set) {
|
|
84832
|
+
set.AddFunction(ScalarFunction("even", {LogicalType::DOUBLE}, LogicalType::DOUBLE,
|
|
84833
|
+
UnaryDoubleFunctionWrapper<double, EvenOperator>));
|
|
84834
|
+
}
|
|
84835
|
+
|
|
84804
84836
|
} // namespace duckdb
|
|
84805
84837
|
|
|
84806
84838
|
|
|
@@ -84936,6 +84968,8 @@ void BuiltinFunctions::RegisterMathFunctions() {
|
|
|
84936
84968
|
Register<FactorialFun>();
|
|
84937
84969
|
|
|
84938
84970
|
Register<NextAfterFun>();
|
|
84971
|
+
|
|
84972
|
+
Register<EvenFun>();
|
|
84939
84973
|
}
|
|
84940
84974
|
|
|
84941
84975
|
} // namespace duckdb
|
package/src/duckdb.hpp
CHANGED
|
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
10
10
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
|
-
#define DUCKDB_SOURCE_ID "
|
|
14
|
-
#define DUCKDB_VERSION "0.3.1-
|
|
13
|
+
#define DUCKDB_SOURCE_ID "f32f84305"
|
|
14
|
+
#define DUCKDB_VERSION "0.3.1-dev440"
|
|
15
15
|
//===----------------------------------------------------------------------===//
|
|
16
16
|
// DuckDB
|
|
17
17
|
//
|