antirez/redis — pull request #1222 by ripcurld00d (2013-07-27 23:42:39+00:00)
Title: Zsumscore patch

## Introduction
My patch to this feature request https://github.com/antirez/redis/issues/1044

Syntax: ZSUMSCORE key min max

What it does is computing the sum of scores of members, which their scores are between `min` and `max` values, in the sorted set `key`.

Therefore, to compute the sum of scores of all the members in a specific sorted set, run:

ZSUMSCORE sorted_set_name -inf +inf

## Notes
* I have had the notion of adding a new variable, which holds the sum, to the skip-list & zip-list structures. By doing so, I probably achieve better performance (complexity O(1)). However, I guess that it is harder to implement and to test.

* When running the `ZSUMSCORE double` stress test at the unit test, I get inaccurate results. Nevertheless, after replicating it manually, it seems fine. Even though, please note that when the score is with a floating point, the sum is accurate up to the 15th number after the point (or at least that is what I get when running the unit test).

* Would like to hear you comments/ideas.