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

Method IntegerPower

cpp/src/arrow/compute/kernels/base_arithmetic_internal.h:634–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632
633struct Power {
634 ARROW_NOINLINE
635 static uint64_t IntegerPower(uint64_t base, uint64_t exp) {
636 // right to left O(logn) power
637 uint64_t pow = 1;
638 while (exp) {
639 pow *= (exp & 1) ? base : 1;
640 base *= base;
641 exp >>= 1;
642 }
643 return pow;
644 }
645
646 template <typename T, typename Arg0, typename Arg1>
647 static enable_if_integer_value<T> Call(KernelContext*, T base, T exp, Status* st) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected