提交 3ea491c0 编写于 作者: M Max Bruckner

Fix #26: Use long double literal for 1e60

Big thanks at mvollmer (https://sourceforge.net/p/cjson/bugs/45/)
上级 050829f2
...@@ -327,7 +327,7 @@ static char *print_number(const cJSON *item, printbuffer *p) ...@@ -327,7 +327,7 @@ static char *print_number(const cJSON *item, printbuffer *p)
{ {
sprintf(str, "null"); sprintf(str, "null");
} }
else if ((fabs(floor(d) - d) <= DBL_EPSILON) && (fabs(d) < 1.0e60)) else if ((fabs(floor(d) - d) <= DBL_EPSILON) && (fabs(d) < 1.0e60L))
{ {
sprintf(str, "%.0f", d); sprintf(str, "%.0f", d);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册