MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / RelativeDifference

Function RelativeDifference

tests/gpu/GPUUnitTest.cpp:97–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 inline bool RelativeDifference(float x1, float x2, float min_x1, float & diff)
98 {
99 const float absx1 = fabs(x1);
100 const float div = std::max(absx1, min_x1);
101 const float thisDiff = fabs(x1 - x2) / div;
102 if (thisDiff > diff)
103 {
104 diff = thisDiff;
105 return true;
106 }
107 return false;
108 }
109
110 // Return true if diff has been updated.
111 inline bool ComputeDiff(float x1, float x2, bool rel, float min_x1, float & diff)

Callers 1

ComputeDiffFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected