mirror of
https://github.com/DaveGamble/cJSON.git
synced 2026-10-29 12:41:09 +00:00
improve compare_double
This commit is contained in:
1 parent
69bc9ccc20
commit
4e3335618f
1 file changed
+1
-1
+1
-1
@@ -109,7 +109,7 @@ static int compare_strings(const unsigned char *string1, const unsigned char *st
|
|||||||
/* securely comparison of floating-point variables */
|
/* securely comparison of floating-point variables */
|
||||||
static cJSON_bool compare_double(double a, double b)
|
static cJSON_bool compare_double(double a, double b)
|
||||||
{
|
{
|
||||||
return (fabs(a - b) <= a * CJSON_DOUBLE_PRECISION);
|
return (fabs(a - b) <= CJSON_DOUBLE_PRECISION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user