Skip to content

Commit

Permalink
MINOR: [C++] Optimize Gandiva log function (#15294)
Browse files Browse the repository at this point in the history
Gandiva's `log` function computes log_of_base twice.

Authored-by: Jin Shang <shangjin1997@gmail.com>
Signed-off-by: Antoine Pitrou <antoine@python.org>
  • Loading branch information
js8544 authored Jan 12, 2023
1 parent 48da0df commit 252e1e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/src/gandiva/precompiled/extended_math_ops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void set_error_for_logbase(int64_t execution_context, double base) {
set_error_for_logbase(context, static_cast<gdv_float64>(base)); \
return 0; \
} \
return LOGL(value) / LOGL(base); \
return LOGL(value) / log_of_base; \
}

LOG_WITH_BASE(int32, int32, float64)
Expand Down

0 comments on commit 252e1e0

Please sign in to comment.