MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / compare_double

Function compare_double

external/cJSON/cJSON.c:589–593  ·  view source on GitHub ↗

securely comparison of floating-point variables */

Source from the content-addressed store, hash-verified

587
588/* securely comparison of floating-point variables */
589static cJSON_bool compare_double(double a, double b)
590{
591 double maxVal = fabs(a) > fabs(b) ? fabs(a) : fabs(b);
592 return (fabs(a - b) <= maxVal * DBL_EPSILON);
593}
594
595/* Render the number nicely from the given item into a string. */
596static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer)

Callers 2

print_numberFunction · 0.85
cJSON_CompareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected