jl777 7 years ago
parent
commit
d649267c15
  1. 2
      crypto777/cJSON.c

2
crypto777/cJSON.c

@ -508,6 +508,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
length = sprintf((char *)number_buffer, "%llu", (long long)d); length = sprintf((char *)number_buffer, "%llu", (long long)d);
/* Try 8 decimal places of precision to avoid nonsignificant nonzero digits */ /* Try 8 decimal places of precision to avoid nonsignificant nonzero digits */
else length = sprintf((char *)number_buffer, "%0.8f", d); else length = sprintf((char *)number_buffer, "%0.8f", d);
printf("d A -> (%s)\n",number_buffer);
/* Check whether the original double can be recovered */ /* Check whether the original double can be recovered */
if ((sscanf((char *)number_buffer, "%lg", &test) != 1) || ((double)test != d)) if ((sscanf((char *)number_buffer, "%lg", &test) != 1) || ((double)test != d))
@ -516,6 +517,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out
length = sprintf((char *)number_buffer, "%llu", (long long)d); length = sprintf((char *)number_buffer, "%llu", (long long)d);
/* If not, print with 8 decimal places of precision */ /* If not, print with 8 decimal places of precision */
else length = sprintf((char *)number_buffer, "%0.8f", d); else length = sprintf((char *)number_buffer, "%0.8f", d);
printf("d B -> (%s)\n",number_buffer);
} }
} }

Loading…
Cancel
Save