MCPcopy Create free account
hub / github.com/Netis/cloud-probe / compare_double

Function compare_double

cpworker/src/cJSON/cJSON_Utils.c:111–115  ·  view source on GitHub ↗

securely comparison of floating-point variables */

Source from the content-addressed store, hash-verified

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

Callers 2

compare_jsonFunction · 0.70
create_patchesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected