Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[feat] statistics answerer: add the ability to calculate the range of a set

benpiano80046f41d213805
diff --git a/searx/answerers/statistics.py b/searx/answerers/statistics.py
index 5f5ef0c99..abdd1dbf5 100644
--- a/searx/answerers/statistics.py
+++ b/searx/answerers/statistics.py
@@ -21,6 +21,7 @@ kw2func = [
("avg", lambda args: sum(args) / len(args)),
("sum", sum),
("prod", lambda args: reduce(mul, args, 1)),
+ ("range", lambda args: max(args) - min(args)),
]