You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I guess this is technically not a bug, I think it would be nice if the library tested for NAN in cJSON_CreateNumber to avoid this, and also set the int value to a constant. Maybe something like:
item->type = cJSON_Number;
item->valuedouble = num;
if (isnan(num)) {
item->valueint = 0;
}
/* use saturation in case of overflow */
else if (num >= INT_MAX)
...
The text was updated successfully, but these errors were encountered:
Calling cJSON_CreateNumber(NAN) raises a FE_INVALID floating point exception.
Here is a sample code that shows the problem:
While I guess this is technically not a bug, I think it would be nice if the library tested for NAN in cJSON_CreateNumber to avoid this, and also set the int value to a constant. Maybe something like:
The text was updated successfully, but these errors were encountered: