lidavidm commented on code in PR #14434: URL: https://github.com/apache/arrow/pull/14434#discussion_r1002137969
########## cpp/src/arrow/compute/kernels/base_arithmetic_internal.h: ########## @@ -485,6 +485,22 @@ struct NegateChecked { } }; +struct Exp { + template <typename T, typename Arg> + static constexpr enable_if_floating_value<Arg, T> Call(KernelContext*, Arg exp, + Status*) { + static_assert(std::is_same<T, Arg>::value, ""); + return std::exp(exp); + } + + template <typename T, typename Arg> + static constexpr enable_if_decimal_value<Arg, T> Call(KernelContext*, Arg exp, + Status*) { + static_assert(std::is_same<T, Arg>::value, ""); + return exp.Exp(); Review Comment: I guess it's tested below so it should clearly exist… ########## cpp/src/arrow/compute/kernels/base_arithmetic_internal.h: ########## @@ -485,6 +485,22 @@ struct NegateChecked { } }; +struct Exp { + template <typename T, typename Arg> + static constexpr enable_if_floating_value<Arg, T> Call(KernelContext*, Arg exp, + Status*) { + static_assert(std::is_same<T, Arg>::value, ""); + return std::exp(exp); + } + + template <typename T, typename Arg> + static constexpr enable_if_decimal_value<Arg, T> Call(KernelContext*, Arg exp, + Status*) { + static_assert(std::is_same<T, Arg>::value, ""); + return exp.Exp(); Review Comment: Ah, no, this isn't being used at all - decimals are being converted to floats first. Can we remove this? ########## cpp/src/arrow/compute/kernels/base_arithmetic_internal.h: ########## @@ -485,6 +485,22 @@ struct NegateChecked { } }; +struct Exp { + template <typename T, typename Arg> + static constexpr enable_if_floating_value<Arg, T> Call(KernelContext*, Arg exp, + Status*) { + static_assert(std::is_same<T, Arg>::value, ""); + return std::exp(exp); + } + + template <typename T, typename Arg> + static constexpr enable_if_decimal_value<Arg, T> Call(KernelContext*, Arg exp, + Status*) { + static_assert(std::is_same<T, Arg>::value, ""); + return exp.Exp(); Review Comment: Does this actually exist? I don't see a definition for it in (Basic)Decimal128 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org