MCPcopy Index your code
hub / github.com/DaveGamble/cJSON / compare_double

Function compare_double

cJSON_Utils.c:112–116  ·  view source on GitHub ↗

securely comparison of floating-point variables */

Source from the content-addressed store, hash-verified

110
111/* securely comparison of floating-point variables */
112static cJSON_bool compare_double(double a, double b)
113{
114 double maxVal = fabs(a) > fabs(b) ? fabs(a) : fabs(b);
115 return (fabs(a - b) <= maxVal * DBL_EPSILON);
116}
117
118
119/* Compare the next path element of two JSON pointers, two NULL pointers are considered unequal: */

Callers 2

compare_jsonFunction · 0.70
create_patchesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…