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 upsolve the summary issue by defining 'names<-'; fix issue with 'c' #25
Conversation
|
If you expect nanotime objects to be the same, I suggest you use |
|
It's a good point. We should really compare bitwise. |
|
That's all true, but expect users (me first even so I should know better) to get confused by the floating-point semantics of a type that presents itself as discrete. It's true for the underlying type > checkEquals(1L, 2L)
Error in checkEquals(1L, 2L) : Mean relative difference: 1
> checkEquals(as.integer64(1), as.integer64(2))
[1] TRUE |
|
But that is due to the |
|
Yes, yes, but it's about what the users expect: |
I'm not sure about that, given that so many R users get confused about the float-point semantics of floating point types (i.e. R FAQ 7.31).
Agreed. My point is mainly about the unit tests, which are for developers much more than users. And developers are responsible for knowing/understanding the edge cases of their software. So that's why I suggested that you use I'm not suggesting that your expectation and use of This also suggests that there should be a |
3b4ab93
into
eddelbuettel:master
It was enough to define
names<-in order forsummary.integer64to work onnanotime.There was an issue with
c, it was using the double value ofnanotimeinstead of itsinteger64value. Interestingly, the tests work becausenanotimeis originally a double in disguise. SoRUnit::checkEquals, which ultimately callsall.equal(target, current, msg="", tolerance = .Machine$double.eps^0.5)returnsTRUEwhen the values are close together. SocheckEquals(nanotime(1), nanotime(2))returnsTRUE(and this is the case forinteger64too). That's annoying, but I think it's the kind of thingnanotimewill have to live with, because at the end of the day, despite its elegance,integer64is still a hack...