MCPcopy Create free account
hub / github.com/apache/arrow / Call

Method Call

cpp/src/arrow/compute/kernels/scalar_arithmetic.cc:511–522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509struct LogbChecked {
510 template <typename T, typename Arg0, typename Arg1>
511 static enable_if_floating_value<T> Call(KernelContext*, Arg0 x, Arg1 base, Status* st) {
512 static_assert(std::is_same<T, Arg0>::value, "");
513 static_assert(std::is_same<Arg0, Arg1>::value, "");
514 if (x == 0.0 || base == 0.0) {
515 *st = Status::Invalid("logarithm of zero");
516 return x;
517 } else if (x < 0.0 || base < 0.0) {
518 *st = Status::Invalid("logarithm of negative number");
519 return x;
520 }
521 return std::log(x) / std::log(base);
522 }
523};
524
525// Generate a kernel given a bitwise arithmetic functor. Assumes the

Callers

nothing calls this directly

Calls 1

InvalidFunction · 0.50

Tested by

no test coverage detected