You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gprod produces wrong results for large integer64 and for prod(na.rm=TRUE)
library(bit64)
DT= data.table(x=c(lim.integer64(), 1, 1), g=1:2)
DT#> x g#> 1: -9223372036854775807 1#> 2: 9223372036854775807 2#> 3: 1 1#> 4: 1 2DT[, prod(x), g, verbose=TRUE]
#> Argument 'by' after substitute: g#> Detected that j uses these columns: [x]#> Finding groups using forderv ... forder.c received 4 rows and 1 columns#> 0.000s elapsed (0.000s cpu) #> Finding group sizes from the positions (can be avoided to save RAM) ... 0.000s elapsed (0.000s cpu) #> Getting back original order ... forder.c received a vector type 'integer' length 2#> 0.000s elapsed (0.000s cpu) #> lapply optimization is on, j unchanged as 'prod(x)'#> GForce optimized j to 'gprod(x)'#> Making each group and running j (GForce TRUE) ... gforce initial population of grp took 0.000#> gforce assign high and low took 0.001#> gforce eval took 0.000#> 0.000s elapsed (0.001s cpu)#> g V1#> 1: 1 <NA>#> 2: 2 9221120237041092514DT[, base::prod(x), g, verbose=TRUE]
#> Argument 'by' after substitute: g#> Detected that j uses these columns: [x]#> Finding groups using forderv ... forder.c received 4 rows and 1 columns#> 0.000s elapsed (0.000s cpu) #> Finding group sizes from the positions (can be avoided to save RAM) ... 0.000s elapsed (0.000s cpu) #> Getting back original order ... forder.c received a vector type 'integer' length 2#> 0.001s elapsed (0.000s cpu) #> lapply optimization is on, j unchanged as 'base::prod(x)'#> GForce is on, left j unchanged#> Old mean optimization is on, left j unchanged.#> Making each group and running j (GForce FALSE) ... #> collecting discontiguous groups took 0.000s for 2 groups#> eval(j) took 0.000s for 2 calls#> 0.000s elapsed (0.000s cpu)#> g V1#> 1: 1 -9223372036854775807#> 2: 2 9223372036854775807
edit1:
It also does not handle na.rm=TRUE correctly for integer64.
gprod
produces wrong results for largeinteger64
and forprod(na.rm=TRUE)
edit1:
It also does not handle
na.rm=TRUE
correctly forinteger64
.edit2:
Ok it doesn't even have to be "large"
integer64
sessionInfo()
The text was updated successfully, but these errors were encountered: