You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throwstd::runtime_error("Result of addition will overflow.");
31
-
});
32
-
m.def("safe_subtract", [](int64_t i, int64_t j) {
33
-
int64_t k;
34
-
bool result = dp::SafeSubtract(i, j, &k);
35
-
if (result) return k;
36
-
throwstd::runtime_error("Result of subtraction will overflow.");
37
-
});
38
-
m.def("safe_square", [](int64_t i) {
39
-
int64_t k;
40
-
bool result = dp::SafeSquare(i, &k);
41
-
if (result) return k;
42
-
throwstd::runtime_error("Result of squaring will overflow.");
43
-
});
44
-
}
13
+
m.def(
14
+
"xor_strings", &dp::XorStrings,
15
+
R"pbdoc(Character-wise XOR of two strings. In case of differing string lengths, operation will be performed by the repeated concatenation of the smaler string till it is of the same length as the longer before the performance of the XOR operation.)pbdoc");
16
+
m.def("default_epsilon", &dp::DefaultEpsilon); // deprecated, default epsilon value
17
+
m.def(
18
+
"get_next_power_of_two", &dp::GetNextPowerOfTwo,
19
+
R"pbdoc(Outputs value of a power of two that is greater than and closest to the given numerical input.)pbdoc");
20
+
m.def(
21
+
"qnorm", &dp::Qnorm,
22
+
R"pbdoc(Quantile function of normal distribution, inverse of the cumulative distribution function.)pbdoc");
23
+
m.def(
24
+
"mean", &dp::Mean<double>,
25
+
R"pbdoc(Calculation of the mean of given set of numbers for a double int data type.)pbdoc");
26
+
m.def(
27
+
"mean", &dp::Mean<int>,
28
+
R"pbdoc(Calculation of the mean of given set of numbers for an int data type.)pbdoc");
29
+
m.def("variance", &dp::Variance<double>,
30
+
R"pbdoc(Calculate variance for a set of values.)pbdoc");
0 commit comments