klion26 commented on PR #10157: URL: https://github.com/apache/arrow-rs/pull/10157#issuecomment-4854640111
Sorry for the late reply, a little busy these days on internal work. > Value-based lossless (e.g. i64 -> i8 may succeed, for values in -128..128) @scovich For the second type, there is some case may be trick: for float64 -> float32, not all float64 in `[float32::MIN, float32::MAX]` can convert to float32 loselesse, this makes the semantics tricky, such as `3f64` and `4f64` can convert to `f32` losslesse, but `f64::PI` can't convert to `f32` lossless, this makes the user a little difficult(not as ease as i64 -> i8) to expect which f64 will convert to f32, this is the reason why I perfer to `identify` API for `as_xxx` API If the value-based lossless conversion for `f64` -> `f32` is receivable for us, then we can implement the `Variant::as_xxx` using the second approach(value-based lossless conversion). -- 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]
