You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "rui-mo (via GitHub)" <gi...@apache.org> on 2024/08/06 02:08:12 UTC

Re: [PR] [VL] Fix High Precision Rounding for Velox [incubator-gluten]

rui-mo commented on code in PR #6707:
URL: https://github.com/apache/incubator-gluten/pull/6707#discussion_r1704812844


##########
cpp/velox/operators/functions/Arithmetic.h:
##########
@@ -38,12 +39,18 @@ struct RoundFunction {
       return number;
     }
 
-    double factor = std::pow(10, decimals);
-    static const TNum kInf = std::numeric_limits<TNum>::infinity();
-    if (number < 0) {
-      return (std::round(std::nextafter(number, -kInf) * factor * -1) / factor) * -1;
+    /*
+     * Using long double for high precision during intermediate calculations.
+     * TODO: Make this more efficient with Boost to support high arbitrary precision at runtime.
+     */

Review Comment:
   nit: use `//` for comments.



-- 
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: commits-unsubscribe@gluten.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org