MCPcopy Create free account
hub / github.com/ETLCPP/etl / compare_gray_to_binary

Function compare_gray_to_binary

test/test_binary.cpp:188–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 // Slow gray to binary
187 template <typename T>
188 T compare_gray_to_binary(T value_)
189 {
190 typedef typename std::make_unsigned<T>::type type;
191
192 type value = type(value_);
193
194 type mask;
195 for (mask = value >> 1U; mask != 0; mask = mask >> 1U)
196 {
197 value = value ^ mask;
198 }
199
200 return static_cast<T>(value);
201 }
202
203 SUITE(test_binary)
204 {

Callers 1

TESTFunction · 0.85

Calls 1

typeClass · 0.85

Tested by

no test coverage detected