paleolimbot edited a comment on pull request #11652:
URL: https://github.com/apache/arrow/pull/11652#issuecomment-967045997


   As of this PR, integer floor division (e.g., `1L %/% 0L`) does return a 
surprising value (INT_MAX) (and I believe it did before too). Everything else 
returns a float64 int. I wasn't sure how to fix that using the machinery that I 
know about but perhaps there is a way?
   
   ``` r
   # remotes::install_github("apache/arrow/r")
   library(arrow, warn.conflicts = FALSE)
   library(dplyr, warn.conflicts = FALSE)
   
   RecordBatch$create(number = 1L) %>% 
     mutate(floordiv = number %/% 0L) %>%
     collect()
   #> # A tibble: 1 × 2
   #>   number   floordiv
   #>    <int>      <int>
   #> 1      1 2147483647
   ```
   
   ``` r
   # remotes::install_github("apache/arrow/r#11652")
   library(arrow, warn.conflicts = FALSE)
   library(dplyr, warn.conflicts = FALSE)
   
   RecordBatch$create(number = 1L) %>% 
     mutate(floordiv = number %/% 0L) %>%
     collect()
   #> # A tibble: 1 × 2
   #>   number   floordiv
   #>    <int>      <int>
   #> 1      1 2147483647
   ```
   


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


Reply via email to