commit 87f55416c18f9663587ae274627529498696a3eb
parent c15e09d2a62022935ff9de2c98185ddc24341440
Author: Dave Gamble <davegamble@gmail.com>
Date: Sun, 29 May 2016 16:01:06 +0100
we can safely remove this, since the initial d==0 case catches this.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cJSON.c b/cJSON.c
@@ -166,7 +166,7 @@ static char *print_number(cJSON *item,printbuffer *p)
else str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */
if (str)
{
- if (fpclassify(d) != FP_ZERO && !isnormal(d)) sprintf(str,"null");
+ if (!isnormal(d)) sprintf(str,"null");
else if (fabs(floor(d)-d)<=DBL_EPSILON && fabs(d)<1.0e60) sprintf(str,"%.0f",d);
else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d);
else sprintf(str,"%f",d);