You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "izveigor (via GitHub)" <gi...@apache.org> on 2023/06/15 17:32:12 UTC

[GitHub] [arrow-rs] izveigor commented on a diff in pull request #4180: feat: Float16 cast

izveigor commented on code in PR #4180:
URL: https://github.com/apache/arrow-rs/pull/4180#discussion_r1210783826


##########
arrow-cast/src/cast.rs:
##########
@@ -4821,6 +5011,29 @@ mod tests {
         let array: &Decimal256Array = array.as_primitive();
         assert!(array.is_null(4));
 
+        // test f16 to decimal type
+        let array = Float16Array::from(vec![
+            Some(f16::from_f32(1.1)),
+            Some(f16::from_f32(2.2)),
+            Some(f16::from_f32(4.4)),
+            None,
+            Some(f16::from_f32(1.125_4)), // round down
+            Some(f16::from_f32(1.165_4)), // round up
+        ]);
+        generate_cast_test_case!(
+            &array,
+            Decimal256Array,
+            &decimal_type,
+            vec![
+                Some(i256::from_i128(1099609_i128)), // round down

Review Comment:
   I can't explain why it is not a round number.



-- 
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