securely comparison of floating-point variables */
| 109 | |
| 110 | /* securely comparison of floating-point variables */ |
| 111 | static 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: */ |
| 118 | static cJSON_bool compare_pointers(const unsigned char *name, const unsigned char *pointer, |
no outgoing calls
no test coverage detected