You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Owen Nichols (Jira)" <ji...@apache.org> on 2022/06/22 20:47:03 UTC

[jira] [Closed] (GEODE-9342) Handle a double reply of "inf" in the same way as Redis

     [ https://issues.apache.org/jira/browse/GEODE-9342?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Owen Nichols closed GEODE-9342.
-------------------------------

> Handle a double reply of "inf" 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
>            Assignee: Ray Ingles
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.15.0
>
>
> 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.20.7#820007)