I am using rediscala @ 1.4.2. If I add a member to a sorted set with positive or negative infinity as the score, running the zscore command for that member of the sorted set results in an exception due to parseDouble.
In the example below, we get inf and -inf as the resulting scores from redis.
However, java.lang.Double.parseDouble expects Infinity or -Infinity. Also below is an example trying to parse inf.
$ scala
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_31).
Type in expressions to have them evaluated.
Type :help for more information.
scala> Double.PositiveInfinity
res0: Double = Infinity
scala> Double.PositiveInfinity.toString
res1: String = Infinity
scala> java.lang.Double.parseDouble(res1)
res3: Double = Infinity
scala> Double.NegativeInfinity.toString
res4: String = -Infinity
scala> java.lang.Double.parseDouble(res4)
res5: Double = -Infinity
scala> java.lang.Double.parseDouble("inf")
java.lang.NumberFormatException: For input string: "inf"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
at java.lang.Double.parseDouble(Double.java:538)
... 33 elided
scala> :q
I am using
rediscala
@ 1.4.2. If I add a member to a sorted set with positive or negative infinity as the score, running thezscore
command for that member of the sorted set results in an exception due toparseDouble
.In the example below, we get
inf
and-inf
as the resulting scores from redis.However,
java.lang.Double.parseDouble
expectsInfinity
or-Infinity
. Also below is an example trying to parseinf
.