edponce commented on a change in pull request #10349:
URL: https://github.com/apache/arrow/pull/10349#discussion_r659957016
##########
File path: docs/source/cpp/compute.rst
##########
@@ -312,6 +313,79 @@ precision of `divide` is at least the sum of precisions of
both operands with
enough scale kept. Error is returned if the result precision is beyond the
decimal value range.
+Rounding functions
+~~~~~~~~~~~~~~~~~~
+
+These functions displace numeric input(s) to approximate and shorter numeric
+representation(s). Integral input(s) produce floating-point output(s) of same
value.
+If any of the input element(s) is null, the corresponding output element is
null.
+
++---------------+------------+-------------+-------------+----------------------------------+
+| Function name | Arity | Input types | Output type | Notes | Options
class |
++===============+============+=============+=============+==================================+
+| mround | Unary | Numeric | Float32/64 | (1)(2) |
:struct:`MRoundOptions` |
++---------------+------------+-------------+-------------+----------------------------------+
+| round | Unary | Numeric | Float32/64 | (1)(3) |
:struct:`RoundOptions` |
++---------------+------------+-------------+-------------+----------------------------------+
+
+* \(1) Output value is a 64-bit floating-point for integral inputs and the
+ retains the same type for floating-point inputs. By default rounding
functions
+ displace a value to the nearest integer with a round to even for breaking
ties.
+ Options are available to control the rounding behavior.
+* \(2) The ``multiple`` option specifies the rounding
+ scale and precision. Only the magnitude of the ``rounding multiple`` is
used,
+ its sign is ignored.
+* \(3) The ``ndigits`` option specifies the rounding precision in
+ terms of number of digits. A negative value corresponds to digits in the
+ non-decimal part.
+
++-------------------------+---------------------------------+
+| Round mode | Description/Examples |
++=========================+=================================+
+| DOWNWARD | Equivalent to ``floor(x)`` |
+| TOWARDS_NEG_INFINITY | 3.7 = 3, -3.2 = -4 |
Review comment:
Agree, good observation.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]