bkietz commented on a change in pull request #10364:
URL: https://github.com/apache/arrow/pull/10364#discussion_r646714303
##########
File path: docs/source/cpp/compute.rst
##########
@@ -286,11 +286,29 @@ an ``Invalid`` :class:`Status` when overflow is detected.
+--------------------------+------------+--------------------+---------------------+
| power_checked | Binary | Numeric | Numeric
|
+--------------------------+------------+--------------------+---------------------+
-| subtract | Binary | Numeric | Numeric
|
+| subtract | Binary | Numeric | Numeric (1)
|
+--------------------------+------------+--------------------+---------------------+
-| subtract_checked | Binary | Numeric | Numeric
|
+| subtract_checked | Binary | Numeric | Numeric (1)
|
+--------------------------+------------+--------------------+---------------------+
+* \(1) Precision and scale of computed DECIMAL results
+
++------------+---------------------------------------------+
+| Operation | Result precision and scale |
++============+=============================================+
+| | add | | scale = max(s1, s2) |
+| | subtract | | precision = max(p1-s1, p2-s2) + 1 + scale |
++------------+---------------------------------------------+
+| multiply | | scale = s1 + s2 |
+| | | precision = p1 + p2 + 1 |
++------------+---------------------------------------------+
+| divide | | scale = max(4, s1 + p2 - s2 + 1) |
+| | | precision = p1 - s1 + s2 + scale |
Review comment:
Ah, I see. Thanks
--
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:
[email protected]