R's data.table Truncating Bits?
<p>So I'm a huge <code>data.table</code> fan in R.  I use it almost all the time but have come across a situation in which it won't work for me at all.  I have a package (internal to my company) that uses R's <code>double</code> to store the value of an unsigned 64 bit integer whose bit sequence corresponds to some fancy encoding.  This package works very nicely everywhere except data.table.  I found that if I aggregate on a column of this data that I lose a large number of my unique values.  My only guess here is that <code>data.table</code> is truncating bits in some kind of weird <code>double</code> optimization.</p>

<p>Can anyone confirm that this is the case?  Is this simply a bug?</p>

<p>Below see a reproduction of the issue and comparison to the package I currently must use but want to avoid with a passion (<code>dplyr</code>).</p>

<pre><code>temp &lt;- structure(list(obscure_math = c(6.95476896592629e-309, 6.95476863436446e-309, 
6.95476743245288e-309, 6.95476942182375e-309, 6.95477149408563e-309, 
6.95477132830476e-309, 6.95477132830476e-309, 6.95477149408562e-309, 
6.95477174275702e-309, 6.95476880014538e-309, 6.95476896592647e-309, 
6.95476896592647e-309, 6.95476900737172e-309, 6.95476900737172e-309, 
6.95476946326899e-309, 6.95476958760468e-309, 6.95476958760468e-309, 
6.95477020928318e-309, 6.95477124541406e-309, 6.95476859291965e-309, 
6.95476875870014e-309, 6.95476904881676e-309, 6.95476904881676e-309, 
6.95476904881676e-309, 6.95476909026199e-309, 6.95476909026199e-309, 
6.95476909026199e-309, 6.95476909026199e-309, 6.9547691317072e-309, 
6.9547691317072e-309, 6.9547691317072e-309, 6.9547691317072e-309, 
6.9547691317072e-309, 6.9547691317072e-309, 6.9547691317072e-309, 
6.9547691317072e-309, 6.9547691317072e-309, 6.9547691317072e-309, 
6.9547691317072e-309, 6.9547691317072e-309, 6.95477211576406e-309, 
6.95476880014538e-309, 6.95476880014538e-309, 6.95476880014538e-309, 
6.95476892448104e-309, 6.95476880014538e-309, 6.95476892448105e-309, 
6.9547689659263e-309, 6.95476913170719e-309, 6.95476933893334e-309
)), .Names = "obscure_math", class = c("data.table", "data.frame"), row.names = c(NA, 
-50L))

dt_collapsed &lt;- temp[, .(count=.N), by=obscure_math]
nrow(dt_collapsed) == length(unique(temp$obscure_math))

setDF(temp)
dplyr_collapsed &lt;- temp %&gt;% group_by(obscure_math) %&gt;% summarise(count=n())
nrow(dplyr_collapsed) == length(unique(temp$obscure_math))
</code></pre>