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

[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4323: fix date conversion if timestamp below unixtimestamp

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


##########
arrow-cast/src/cast.rs:
##########
@@ -1853,7 +1853,7 @@ pub fn cast_with_options(
                 if time_array.is_null(i) {
                     b.append_null();
                 } else {
-                    b.append_value((time_array.value(i) / from_size) as i32);
+                    b.append_value(f64::floor(time_array.value(i) as f64 / from_size as f64) as i32);

Review Comment:
   Perhaps we could use https://docs.rs/num/latest/num/integer/fn.div_floor.html or something?



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