Skip to content

between could coerce bounds num to int if possible #3517

@jangorecki

Description

@jangorecki

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions