| 25 | #endif |
| 26 | |
| 27 | void |
| 28 | testClass ( |
| 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 | |
| 70 | float |
| 71 | floatPosInfinity () |
no test coverage detected