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

Function HalfForCompare

src/OpenColorIO/MathUtils.cpp:531–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531inline int HalfForCompare(const half h)
532{
533 // Map neg 0 and pos 0 to 32768, allowing tolerance-based comparison
534 // of small numbers of mixed sign.
535 const int rawHalf = h.bits();
536 return rawHalf < 32767 ? rawHalf + 32768 : 2 * 32768 - rawHalf;
537}
538
539bool HalfsDiffer(const half expected, const half actual, const int tolerance)
540{

Callers 1

HalfsDifferFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected