Sarah Abbey created GEODE-9342:
----------------------------------

             Summary: Handle a double reply of "Infinite" in the same way as 
Redis
                 Key: GEODE-9342
                 URL: https://issues.apache.org/jira/browse/GEODE-9342
             Project: Geode
          Issue Type: Improvement
          Components: redis
    Affects Versions: 1.15.0
            Reporter: Sarah Abbey


Currently, in `Coder.java` `stringToDouble` and `doubleToString` methods, we 
return "Infinity" or "-Infinity", but native Redis returns "inf" or "-inf" 
respectively, as seen in `networking.c`:
{code:java}
void addReplyDouble(client *c, double d) {
    char dbuf[128], sbuf[128];
    int dlen, slen;
    if (isinf(d)) {
        /* Libc in odd systems (Hi Solaris!) will format infinite in a
         * different way, so better to handle it in an explicit way. */
        addReplyBulkCString(c, d > 0 ? "inf" : "-inf");
    } else {
        dlen = snprintf(dbuf,sizeof(dbuf),"%.17g",d);
        slen = snprintf(sbuf,sizeof(sbuf),"$%d\r\n%s\r\n",dlen,dbuf);
        addReplyString(c,sbuf,slen);
    }
}
{code}

We should return "inf" or "-inf" like native Redis.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to