MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / testClassification

Function testClassification

src/ImathTest/testClassification.cpp:120–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118} // namespace
119
120void
121testClassification ()
122{
123 cout << "classification of bit patterns\n\n";
124
125 //
126 // fini norm deno zero nan inf neg
127 //
128
129 testClass (0.0, 1, 0, 0, 1, 0, 0, 0);
130
131 testClass (1.0, 1, 1, 0, 0, 0, 0, 0);
132 testClass (1.0f + HALF_EPSILON, 1, 1, 0, 0, 0, 0, 0);
133 testClass (HALF_DENORM_MIN, 1, 0, 1, 0, 0, 0, 0);
134 testClass (HALF_DENORM_MIN + HALF_DENORM_MIN, 1, 0, 1, 0, 0, 0, 0);
135 testClass (HALF_NRM_MIN, 1, 1, 0, 0, 0, 0, 0);
136 testClass (HALF_NRM_MIN + HALF_DENORM_MIN, 1, 1, 0, 0, 0, 0, 0);
137 testClass (HALF_NRM_MIN - HALF_DENORM_MIN, 1, 0, 1, 0, 0, 0, 0);
138 testClass (2.0f, 1, 1, 0, 0, 0, 0, 0);
139 testClass (3.0f, 1, 1, 0, 0, 0, 0, 0);
140 testClass (0.1f, 1, 1, 0, 0, 0, 0, 0);
141 testClass (0.2f, 1, 1, 0, 0, 0, 0, 0);
142 testClass (0.3f, 1, 1, 0, 0, 0, 0, 0);
143 testClass (HALF_MAX, 1, 1, 0, 0, 0, 0, 0);
144 testClass (floatPosInfinity (), 0, 0, 0, 0, 0, 1, 0);
145 testClass (floatPosQNan1 (), 0, 0, 0, 0, 1, 0, 0);
146 testClass (floatPosQNan2 (), 0, 0, 0, 0, 1, 0, 0);
147
148 testClass (-1.0f, 1, 1, 0, 0, 0, 0, 1);
149 testClass (-1.0f - HALF_EPSILON, 1, 1, 0, 0, 0, 0, 1);
150 testClass (-HALF_DENORM_MIN, 1, 0, 1, 0, 0, 0, 1);
151 testClass (-HALF_DENORM_MIN - HALF_DENORM_MIN, 1, 0, 1, 0, 0, 0, 1);
152 testClass (-HALF_NRM_MIN, 1, 1, 0, 0, 0, 0, 1);
153 testClass (-HALF_NRM_MIN - HALF_DENORM_MIN, 1, 1, 0, 0, 0, 0, 1);
154 testClass (-HALF_NRM_MIN + HALF_DENORM_MIN, 1, 0, 1, 0, 0, 0, 1);
155 testClass (-2.0f, 1, 1, 0, 0, 0, 0, 1);
156 testClass (-3.0f, 1, 1, 0, 0, 0, 0, 1);
157 testClass (-0.1f, 1, 1, 0, 0, 0, 0, 1);
158 testClass (-0.2f, 1, 1, 0, 0, 0, 0, 1);
159 testClass (-0.3f, 1, 1, 0, 0, 0, 0, 1);
160 testClass (-HALF_MAX, 1, 1, 0, 0, 0, 0, 1);
161 testClass (floatNegInfinity (), 0, 0, 0, 0, 0, 1, 1);
162 testClass (floatNegQNan1 (), 0, 0, 0, 0, 1, 0, 1);
163 testClass (floatNegQNan2 (), 0, 0, 0, 0, 1, 0, 1);
164
165 cout << "\n";
166
167 testClass (half::posInf (), 0, 0, 0, 0, 0, 1, 0);
168 testClass (half::negInf (), 0, 0, 0, 0, 0, 1, 1);
169 testClass (half::qNan (), 0, 0, 0, 0, 1, 0, 0);
170 testClass (half::sNan (), 0, 0, 0, 0, 1, 0, 0);
171
172 cout << "ok\n\n" << flush;
173}

Callers

nothing calls this directly

Calls 7

testClassFunction · 0.85
floatPosInfinityFunction · 0.70
floatPosQNan1Function · 0.70
floatPosQNan2Function · 0.70
floatNegInfinityFunction · 0.70
floatNegQNan1Function · 0.70
floatNegQNan2Function · 0.70

Tested by

no test coverage detected