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

Function ValidateInf

tests/gpu/GPUUnitTest.cpp:42–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 CONSISTANT
41 };
42 inline LimitsDiff ValidateInf(float x1, float x2)
43 {
44 if ( (fabs(x1) < largeThreshold && fabs(x2) < largeThreshold)
45 // If either value is NaN, consider this a NaN error rather than an Inf error.
46 || (std::isnan(x1) || std::isnan(x2)) )
47 {
48 return NOT_APPLICABLE;
49 }
50 if (((x1 >= largeThreshold) && (x2 < largeThreshold)) ||
51 ((x1 < largeThreshold) && (x2 >= largeThreshold)) ||
52 ((x1 <= -largeThreshold) && (x2 > -largeThreshold)) ||
53 ((x1 > -largeThreshold) && (x2 <= -largeThreshold)))
54 {
55 return INCONSISTANT;
56 }
57 return CONSISTANT;
58 }
59
60 inline LimitsDiff ValidateNan(float x1, float x2)
61 {

Callers 1

DiffComponentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected