Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different results for bit64::as.integer64(10L, 20L) and bit64::as.integer64(c(10L, 20L)) #123

Closed
edward-burn opened this issue Dec 29, 2024 · 1 comment

Comments

@edward-burn
Copy link

I was looking into a test failure on the development dbplyr (tidyverse/dbplyr#1564) and it seems to be caused by the below. I'm not sure if it is a bug, but I thought I'd report here in case (as it seems to be a test that used to pass but no longer)

https://github.com/tidyverse/dbplyr/blob/572693098d0098018b6bb2d1e88b650d2e1e1580/tests/testthat/test-backend-postgres.R#L338

bit64::as.integer64(10L)
#> integer64
#> [1] 10
bit64::as.integer64(20L)
#> integer64
#> [1] 20
# as is in test
bit64::as.integer64(10L, 20L)
#> integer64
#> [1] 10
# workaround
bit64::as.integer64(c(10L, 20L))
#> integer64
#> [1] 10 20

Created on 2024-12-29 with reprex v2.1.0

@MichaelChirico
Copy link
Collaborator

bit64::as.integer64(10L, 20L) looks wrong, I would not expect this to work, the "workaround" is the canonical approach.

The behavior to just ignore all but the first argument is the same as the behavior of as.numeric(), as.integer(), as.character()....

I also checked all released {bit64} versions since 0.9-2 (2012) and current main and they all give the same thing for as.integer64(10L,20L), so I don't see any change in behavior either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants