You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/07/15 21:15:56 UTC

[GitHub] [arrow] lidavidm commented on a change in pull request #10727: ARROW-12745: [C++][Compute] Add floor, ceiling, and truncate kernels

lidavidm commented on a change in pull request #10727:
URL: https://github.com/apache/arrow/pull/10727#discussion_r670807189



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -1495,6 +1516,21 @@ const FunctionDoc log1p_checked_doc{
      "Use function \"log1p\" if you want non-positive values to return "
      "-inf or NaN."),
     {"x"}};
+
+const FunctionDoc floor_doc{
+    "Calculate the greatest integer less than or equal to the argument element-wise",
+    "",
+    {"x"}};
+
+const FunctionDoc ceiling_doc{
+    "Calculate the least integer greater than or equal to the argument element-wise",
+    "",
+    {"x"}};
+
+const FunctionDoc truncate_doc{
+    "Calculate the nearest integer not greater than to the argument element-wise",

Review comment:
       Ah, not greater in *magnitude* according to cppreference. Maybe that should be clarified.

##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic.cc
##########
@@ -1495,6 +1516,21 @@ const FunctionDoc log1p_checked_doc{
      "Use function \"log1p\" if you want non-positive values to return "
      "-inf or NaN."),
     {"x"}};
+
+const FunctionDoc floor_doc{
+    "Calculate the greatest integer less than or equal to the argument element-wise",
+    "",
+    {"x"}};
+
+const FunctionDoc ceiling_doc{
+    "Calculate the least integer greater than or equal to the argument element-wise",
+    "",
+    {"x"}};
+
+const FunctionDoc truncate_doc{
+    "Calculate the nearest integer not greater than to the argument element-wise",

Review comment:
       This means we truncate towards negative infinity? (e.g. truncate(-1.1) = -2 since -1 > -1.1?)




-- 
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-unsubscribe@arrow.apache.org

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