Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upnanotime(NA) should not return a nanotime #26
Comments
lsilvest
commented
Jun 5, 2017
|
|
|
It's actually most likely a formatting issue, but > is.na(nanotime(NA))
[1] TRUE
attr(,".S3Class")
[1] "integer64"
attr(,"class")
[1] "nanotime"
attr(,"class")attr(,"package")
[1] "nanotime" |
|
Ditto for other non-finite values it seems: R> nanotime(c(-Inf, NA, NaN, Inf))
[1] "1677-09-21T00:12:43.145224192+00:00" "1677-09-21T00:12:43.145224192+00:00"
[3] "1677-09-21T00:12:43.145224192+00:00" "1677-09-21T00:12:43.145224192+00:00"
Warning message:
In as.integer64.double(x, keep.names = TRUE) :
NAs produced by integer64 overflow
R> The warning comes from the |
|
Yes, you are right, we need to take care of these other cases too. I'll get a patch together for that. |
|
Now fixed: R> nanotime(c(-Inf, NA, NaN, Inf))
[1] NA NA NA NA
Warning message:
In as.integer64.double(x, keep.names = TRUE) :
NAs produced by integer64 overflow
R> |