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

Function testClass

src/ImathTest/testClassification.cpp:27–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25#endif
26
27void
28testClass (
29 half h,
30 bool finite,
31 bool normalized,
32 bool denormalized,
33 bool zero,
34 bool nan,
35 bool infinity,
36 bool negative)
37{
38 cout.width (15);
39 cout.precision (8);
40
41 cout << h << " ";
42 printBits (cout, h);
43 cout << " ";
44
45 if (h.isFinite ()) cout << "finite ";
46
47 if (h.isNormalized ()) cout << "normalized ";
48
49 if (h.isDenormalized ()) cout << "denormalized ";
50
51 if (h.isZero ()) cout << "zero ";
52
53 if (h.isNan ()) cout << "nan ";
54
55 if (h.isInfinity ()) cout << "infinity ";
56
57 if (h.isNegative ()) cout << "negative ";
58
59 cout << endl;
60
61 assert (h.isFinite () == finite);
62 assert (h.isNormalized () == normalized);
63 assert (h.isDenormalized () == denormalized);
64 assert (h.isZero () == zero);
65 assert (h.isNan () == nan);
66 assert (h.isInfinity () == infinity);
67 assert (h.isNegative () == negative);
68}
69
70float
71floatPosInfinity ()

Callers 1

testClassificationFunction · 0.85

Calls 8

printBitsFunction · 0.85
isFiniteMethod · 0.80
isNormalizedMethod · 0.80
isDenormalizedMethod · 0.80
isZeroMethod · 0.80
isNanMethod · 0.80
isInfinityMethod · 0.80
isNegativeMethod · 0.80

Tested by

no test coverage detected