sabbey37 commented on a change in pull request #6534: URL: https://github.com/apache/geode/pull/6534#discussion_r643505867
########## File path: geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java ########## @@ -228,6 +230,26 @@ private void validateScoreIsDouble(byte[] score) { return members.get(member); } + byte[] zincrby(Region<RedisKey, RedisData> region, RedisKey key, byte[] increment, + byte[] member) { + byte[] score = members.get(member); + byte[] incr = Coder.doubleToBytes( + processIncrement(Coder.bytesToString(increment).toLowerCase())); + + if (score != null) { + incr = Coder.doubleToBytes(Coder.bytesToDouble(score) + Coder.bytesToDouble(incr)); + } Review comment: I imagine you could check the `incr` variable afterwards for `NaN`, something like this, though there might be a better way of doing it: ``` if(Arrays.equals(incr, "NaN".getBytes())) { throw new ArithmeticException(ERROR_OPERATION_PRODUCED_NAN); } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org