You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/21 16:52:51 UTC

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3139: Cast: should get the round result for decimal to a decimal with smaller scale

tustvold commented on code in PR #3139:
URL: https://github.com/apache/arrow-rs/pull/3139#discussion_r1028295853


##########
arrow-cast/src/cast.rs:
##########
@@ -1981,9 +2006,23 @@ fn cast_decimal_to_decimal_safe<const BYTE_WIDTH1: usize, const BYTE_WIDTH2: usi
         } else {
             let array = array.as_any().downcast_ref::<Decimal256Array>().unwrap();
             let div = i256::from_i128(div);
+            let half = div / i256::from_i128(2);
+            // TODO: it's better to implement the neg

Review Comment:
   https://github.com/apache/arrow-rs/pull/3151



-- 
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: github-unsubscribe@arrow.apache.org

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