edponce commented on a change in pull request #10395:
URL: https://github.com/apache/arrow/pull/10395#discussion_r652077943



##########
File path: docs/source/cpp/compute.rst
##########
@@ -255,41 +255,52 @@ Input(s) will be cast to the :ref:`common numeric type 
<common-numeric-type>`
 (and dictionary decoded, if applicable) before the operation is applied.
 
 The default variant of these functions does not detect overflow (the result
-then typically wraps around).  Each function is also available in an
+then typically wraps around).  Most functions are also available in an
 overflow-checking variant, suffixed ``_checked``, which returns
 an ``Invalid`` :class:`Status` when overflow is detected.
 
-+--------------------------+------------+--------------------+---------------------+
-| Function name            | Arity      | Input types        | Output type     
    |
-+==========================+============+====================+=====================+
-| abs                      | Unary      | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| abs_checked              | Unary      | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| add                      | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| add_checked              | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| divide                   | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| divide_checked           | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| multiply                 | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| multiply_checked         | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| negate                   | Unary      | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| negate_checked           | Unary      | Signed Numeric     | Signed Numeric  
    |
-+--------------------------+------------+--------------------+---------------------+
-| power                    | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| power_checked            | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| subtract                 | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
-| subtract_checked         | Binary     | Numeric            | Numeric         
    |
-+--------------------------+------------+--------------------+---------------------+
++--------------------------+------------+--------------------+---------------------+-------+
+| Function name            | Arity      | Input types        | Output type     
    | Notes |
++==========================+============+====================+=====================+=======+
+| abs                      | Unary      | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| abs_checked              | Unary      | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| add                      | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| add_checked              | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| divide                   | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| divide_checked           | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| multiply                 | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| multiply_checked         | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| negate                   | Unary      | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| negate_checked           | Unary      | Signed Numeric     | Signed Numeric  
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| power                    | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| power_checked            | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| sign                     | Unary      | Numeric            | Int8            
    | \(1)  |
++--------------------------+------------+--------------------+---------------------+-------+
+| sign_with_signed_zero    | Unary      | Numeric            | Int8            
    | \(2)  |
++--------------------------+------------+--------------------+---------------------+-------+
+| subtract                 | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+| subtract_checked         | Binary     | Numeric            | Numeric         
    |       |
++--------------------------+------------+--------------------+---------------------+-------+
+
+* \(1) Output is an integral representing the signedness of the input.
+  For nonzero inputs, output is any of (-1,1) and 0 for zero input.
+
+* \(2) Similar to ``sign`` but zero input is considered as a signed number.

Review comment:
       The `sign_with_signed_zero` variant treats 0 as a positive value for 
integral types, but either -0 or +0 for floating-point types.




-- 
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.

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


Reply via email to