diff --git a/cJSON.c b/cJSON.c index cac1164b..c0866903 100644 --- a/cJSON.c +++ b/cJSON.c @@ -570,7 +570,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out { length = sprintf((char*)number_buffer, "null"); } - else if(d == (double)item->valueint) + else if (compare_double(d, (double)item->valueint)) { length = sprintf((char*)number_buffer, "%d", item->valueint); }