After zadding the following : zadd k1 Inf m zadd k2 -Inf m The Infinity calculations are not consistent in zinterstore. zunionstore dest 2 k1 k2 weights 0 1 results in "m" with -Inf score zunionstore dest 2 k1 k2 weights 1 0 results in "m" with Inf score zinterstore dest 2 k1 k2 weights 0 1 results in "m" with -Inf score zinterstore dest 2 k1 k2 weights 1 0 results in "m" with 0
I'm assuming that in redis, Infinity * 0 == -Infinity * 0 == 0. This is occurring in redis 3.2.8 and 4.0-rc2
Comment From: bmerry
I've run into something similar. Poking through the code, it looks like ZUNIONSTORE does a nan-to-zero on the individual score*weight products, while ZINTERSTORE does it only on the first one and then on the result of each sum aggregation. This is in 5.0.7.