augustoasilva commented on a change in pull request #11415:
URL: https://github.com/apache/arrow/pull/11415#discussion_r744027521



##########
File path: cpp/src/gandiva/precompiled/extended_math_ops.cc
##########
@@ -249,6 +265,26 @@ ROUND_DECIMAL(float64)
 ROUND_DECIMAL_TO_SCALE(float32)
 ROUND_DECIMAL_TO_SCALE(float64)
 
+// rounds the number to the given scale
+FORCE_INLINE
+gdv_float64 bround_float64_int32(gdv_float64 num, gdv_int32 out_scale) {
+  if (out_scale < 0) {
+    out_scale = out_scale * (-1);
+  }
+  gdv_float64 scale_multiplier = get_scale_multiplier(out_scale);
+  gdv_float64 to_round = num * scale_multiplier;

Review comment:
       Ok, I will open a new PR when as soon as this one is merged

##########
File path: cpp/src/gandiva/function_registry_arithmetic.cc
##########
@@ -107,6 +107,13 @@ std::vector<NativeFunction> 
GetArithmeticFunctionRegistry() {
       BINARY_GENERIC_SAFE_NULL_IF_NULL(round, {}, int32, int32, int32),
       BINARY_GENERIC_SAFE_NULL_IF_NULL(round, {}, int64, int32, int64),
 
+      // bround functions
+      NativeFunction("bround", {}, DataTypeVector{float64()}, float64(),
+                     kResultNullIfNull, "bround_float64"),
+
+      NativeFunction("bround", {}, DataTypeVector{float64(), int32()}, 
float64(),

Review comment:
       Ok, I will open a new PR when as soon as this one is merged




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to