diff --git a/src/main/java/redis/clients/jedis/util/DoublePrecision.java b/src/main/java/redis/clients/jedis/util/DoublePrecision.java index 5d090cf209..fba63dbbc7 100644 --- a/src/main/java/redis/clients/jedis/util/DoublePrecision.java +++ b/src/main/java/redis/clients/jedis/util/DoublePrecision.java @@ -26,6 +26,7 @@ public static Double parseFloatingPointNumber(String str) { return Double.NEGATIVE_INFINITY; case "nan": + case "-nan": // for some module commands // TODO: remove return Double.NaN; default: diff --git a/src/test/java/redis/clients/jedis/modules/graph/GraphValuesTest.java b/src/test/java/redis/clients/jedis/modules/graph/GraphValuesTest.java index fe4737e197..8761e0f786 100644 --- a/src/test/java/redis/clients/jedis/modules/graph/GraphValuesTest.java +++ b/src/test/java/redis/clients/jedis/modules/graph/GraphValuesTest.java @@ -38,4 +38,12 @@ public void parseNaN() { Record r = rs.iterator().next(); assertEquals(Double.NaN, r.getValue(0), 0d); } + + @Test + public void parseMinusNaN() { + ResultSet rs = client.graphQuery("db", "RETURN sqrt(-1)"); + assertEquals(1, rs.size()); + Record r = rs.iterator().next(); + assertEquals(Double.NaN, r.getValue(0), 0d); + } }