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

between could coerce bounds num to int if possible #3517

Closed
jangorecki opened this issue Apr 22, 2019 · 1 comment · Fixed by #3518
Closed

between could coerce bounds num to int if possible #3517

jangorecki opened this issue Apr 22, 2019 · 1 comment · Fixed by #3518
Assignees
Milestone

Comments

@jangorecki
Copy link
Member

jangorecki commented Apr 22, 2019

Not sure but this might be regression, we did not have verbose before so cannot easily confirm.
If a bound arg is numeric, then input is coerced to numeric

between(1:5, 2L, 4, verbose=TRUE)
#between parallel processing of double using closed bounds with recycling took    0.000s
#[1] FALSE  TRUE  TRUE  TRUE FALSE

only if all three arguments are integers then processing continue on integers

between(1:5, 2L, 4L, verbose=TRUE)
#between parallel processing of integer with recycling took    0.000s
#[1] FALSE  TRUE  TRUE  TRUE FALSE

I think we should handle that and coerce 4 into 4L. The only problem I think about is that lower and upper can be vectors, so checking for isReallyReal might be expensive?

@jangorecki
Copy link
Member Author

adding check isReallyReal for lower/upper only when x is integer and lower/upper is real should be the optimal way to handle that.

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

Successfully merging a pull request may close this issue.

2 participants