I found this bug while testing redis' sorted sets. The problem appeared when I wanted to add a value very close to 0. The following actions are done with redis-cli:
127.0.0.1:6379> ZADD test -0.000020221356243895889 PrPZck9bNdCcQ9qq3Ia
127.0.0.1:6379> ZRANGE test 0 -1 WITHSCORES
1) "PrPZck9bNdCcQ9qq3Ia"
2) "-2.0221356243895889e-05"
Now, if I want to use the "zrangeWithscores" function from "Database.Redis" on this sorted set, this happens:
runRedis conn $ zrangeWithscores "test" 0 (-1)
Right [("PrPZck9bNdCcQ9qq3Ia",-2.022135624389589)]
This is wrong, as it ignores the "e-05" part, which makes a big difference in this case.
I found this bug while testing redis' sorted sets. The problem appeared when I wanted to add a value very close to 0. The following actions are done with redis-cli:
Now, if I want to use the "zrangeWithscores" function from "Database.Redis" on this sorted set, this happens:
This is wrong, as it ignores the "e-05" part, which makes a big difference in this case.
I think the problem might be here: https://github.com/informatikr/hedis/blob/master/src/Database/Redis/Types.hs (lines 68-69).
as