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

Function compare_double

cpworker/src/cJSON/cJSON.c:546–550  ·  view source on GitHub ↗

securely comparison of floating-point variables */

Source from the content-addressed store, hash-verified

544
545/* securely comparison of floating-point variables */
546static cJSON_bool compare_double(double a, double b)
547{
548 double maxVal = fabs(a) > fabs(b) ? fabs(a) : fabs(b);
549 return (fabs(a - b) <= maxVal * DBL_EPSILON);
550}
551
552/* Render the number nicely from the given item into a string. */
553static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)

Callers 2

print_numberFunction · 0.70
cJSON_CompareFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected