[
https://issues.apache.org/jira/browse/ARROW-12744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17346314#comment-17346314
]
Eduardo Ponce commented on ARROW-12744:
---------------------------------------
C++ provides a
[std::round()|https://en.cppreference.com/w/cpp/numeric/math/round] function
where the [rounding
mode|https://en.cppreference.com/w/cpp/numeric/fenv/FE_round] can be set at
runtime. Note that library implementations can provide additional rounding
modes or support a subset. It seems there is no *round-half-to-even/odd*
defined in spec.
1. Should the Arrow *round* kernel make use of *std::round* and extend the
rounding modes to support *round-half-to-even/odd* and only in these cases
implement them explicitly?
2. Also, *std::round()* provides versions where it outputs integral data
instead of floating-point. Are these variants desirable in Arrow?
> [C++] Add rounding kernel
> -------------------------
>
> Key: ARROW-12744
> URL: https://issues.apache.org/jira/browse/ARROW-12744
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Reporter: Ian Cook
> Assignee: Eduardo Ponce
> Priority: Major
>
> Kernel to round an array of floating point numbers. Should return an array of
> the same type as the input. Should have an option to control how many digits
> after the decimal point (default value 0 meaning round to the nearest
> integer).
> Midpoint values (e.g. 0.5 rounded to nearest integer) should round away from
> zero (up for positive numbers, down for negative numbers).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)