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

is.nan.integer64() and is.infinite.integer64() don't return TRUE for NaN and Inf values respectively #36

Closed
Rosie23 opened this issue Sep 23, 2024 · 1 comment

Comments

@Rosie23
Copy link

Rosie23 commented Sep 23, 2024

is.nan.integer64 doesn't return TRUE for NaN values
is.infinite.integer64 doesn't return TRUE for Inf values

  is.nan.integer64(NaN) # FALSE
  as.integer64(NaN) # NA
  is.nan.integer64(as.integer64(NaN)) # FALSE
  
  is.infinite.integer64(Inf) # FALSE
  as.integer64(Inf) # NA Warning message: In as.integer64.double(Inf) : NAs produced by integer64 overflow
  is.infinite.integer64(as.integer64(Inf)) # FALSE
@Rosie23 Rosie23 changed the title is.nan.integer64 doesn't return TRUE for NaN values is.nan.integer64() and is.infinite.integer64() don't return TRUE for NaN and Inf values respectively Sep 23, 2024
@MichaelChirico
Copy link
Collaborator

MichaelChirico commented Oct 16, 2024

Inf and NaN are not integer64 values, they are doubles.

Also, don't call is.nan.integer64() or is.infinite.integer64() directly -- call is.nan() and is.infinite() and rely on S3 dispatch to do so.

is.infinite(NA_real_) is FALSE, so is.infinite(NA_integer64_) should also be FALSE.

We could add an error in is.nan.integer64() and is.infinite.integer64() if they are called with non-integer64 input, but I'd rather just unexport them to make doing so very difficult (require ::: access: #76.

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