cyb70289 commented on a change in pull request #10364:
URL: https://github.com/apache/arrow/pull/10364#discussion_r645625763
##########
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:
The extra `|` are added delibrately to show multiple lines in the table.
Otherwise, the two lines in a table cell will be shown in one line in the
browser.
I checked the rst output in an [online rst
editor](http://rst.ninjs.org/#Ky0tLS0tLS0tLS0tLSstLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rCnwgT3BlcmF0aW9uICB8IFJlc3VsdCBwcmVjaXNpb24gYW5kIHNjYWxlICAgICAgICAgICAgICAgICAgfAorPT09PT09PT09PT09Kz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSsKfCB8IGFkZCAgICAgIHwgfCBzY2FsZSA9IG1heChzMSwgczIpICAgICAgICAgICAgICAgICAgICAgICB8CnwgfCBzdWJ0cmFjdCB8IHwgcHJlY2lzaW9uID0gbWF4KHAxLXMxLCBwMi1zMikgKyAxICsgc2NhbGUgfAorLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKCgorLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsKfCBPcGVyYXRpb24gIHwgUmVzdWx0IHByZWNpc2lvbiBhbmQgc2NhbGUgICAgICAgICAgICAgICAgICB8Cis9PT09PT09PT09PT0rPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Kwp8IGFkZCAgICAgICAgfCBzY2FsZSA9IG1heChzMSwgczIpICAgICAgICAgICAgICAgICAgICAgICAgIHwKfCBzdWJ0cmFjdCAgIHwgcHJlY2lzaW9uID0gbWF4KHAxLXMxLCBwMi1zMikgKyAxICsgc2NhbGUgICB8CistLS0tLS0tLS0tLS0rLS0tLS
0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKw==).
--
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]