I am using the data.table
package for data processing. I noticed issues with equality and subset when large numbers are involved. Ex:
dt <- data.table(a = c(1, 841026176807, 841026176808))
dt[a==841026176807]
a
1: 841026176807
2: 841026176808
I thought it was loss of precision from numeric type (representation of double/floating point numbers), but this works:
dt[dt$a==841026176807]
a
1: 841026176807
Why is the behavior not consistent? Is this documented somewhere or bug?