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/05/30 20:19:24 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_r1210783118


##########
arrow-cast/src/cast.rs:
##########
@@ -6596,6 +6836,85 @@ mod tests {
         );
     }
 
+    #[test]
+    fn test_cast_from_f16() {
+        let f16_values: Vec<f16> = vec![
+            f16::NEG_INFINITY,
+            f16::from_f32(i16::MIN as f32),
+            f16::from_f32(i8::MIN as f32),
+            f16::from_f32(0_f32),
+            f16::from_f32(u8::MAX as f32),
+            f16::INFINITY,
+        ];
+        let f16_array: ArrayRef = Arc::new(Float16Array::from(f16_values));
+
+        let f64_expected = vec!["-inf", "-32768.0", "-128.0", "0.0", "255.0", "inf"];

Review Comment:
   I didn't find the way in the package `half` how to replace `inf` with `null. Is this a serious problem?



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