| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/global/qnumeric.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | __attribute__((visibility("default"))) bool qIsInf(double d) { return executed 785 times by 66 tests:   qt_is_inf(d);return qt_is_inf(d);Executed by: 
 executed 785 times by 66 tests:   }return qt_is_inf(d);Executed by: 
  | 785 | ||||||||||||
| 9 | - | |||||||||||||
| 10 | - | |||||||||||||
| 11 | - | |||||||||||||
| 12 | - | |||||||||||||
| 13 | - | |||||||||||||
| 14 | __attribute__((visibility("default"))) bool qIsNaN(double d) { return executed 946549 times by 129 tests:   qt_is_nan(d);return qt_is_nan(d);Executed by: 
 executed 946549 times by 129 tests:   }return qt_is_nan(d);Executed by: 
  | 946549 | ||||||||||||
| 15 | - | |||||||||||||
| 16 | - | |||||||||||||
| 17 | - | |||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | __attribute__((visibility("default"))) bool qIsFinite(double d) { return executed 44 times by 1 test:   qt_is_finite(d);return qt_is_finite(d);Executed by: 
 executed 44 times by 1 test:   }return qt_is_finite(d);Executed by: 
  | 44 | ||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | - | |||||||||||||
| 24 | - | |||||||||||||
| 25 | - | |||||||||||||
| 26 | __attribute__((visibility("default"))) bool qIsInf(float f) { return executed 11 times by 2 tests:   qt_is_inf(f);return qt_is_inf(f);Executed by: 
 executed 11 times by 2 tests:   }return qt_is_inf(f);Executed by: 
  | 11 | ||||||||||||
| 27 | - | |||||||||||||
| 28 | - | |||||||||||||
| 29 | - | |||||||||||||
| 30 | - | |||||||||||||
| 31 | - | |||||||||||||
| 32 | __attribute__((visibility("default"))) bool qIsNaN(float f) { return executed 18 times by 2 tests:   qt_is_nan(f);return qt_is_nan(f);Executed by: 
 executed 18 times by 2 tests:   }return qt_is_nan(f);Executed by: 
  | 18 | ||||||||||||
| 33 | - | |||||||||||||
| 34 | - | |||||||||||||
| 35 | - | |||||||||||||
| 36 | - | |||||||||||||
| 37 | - | |||||||||||||
| 38 | __attribute__((visibility("default"))) bool qIsFinite(float f) { return executed 44 times by 1 test:   qt_is_finite(f);return qt_is_finite(f);Executed by: 
 executed 44 times by 1 test:   }return qt_is_finite(f);Executed by: 
  | 44 | ||||||||||||
| 39 | - | |||||||||||||
| 40 | - | |||||||||||||
| 41 | - | |||||||||||||
| 42 | - | |||||||||||||
| 43 | - | |||||||||||||
| 44 | __attribute__((visibility("default"))) double qSNaN() { return executed 21 times by 2 tests:   qt_snan();return qt_snan();Executed by: 
 executed 21 times by 2 tests:   }return qt_snan();Executed by: 
  | 21 | ||||||||||||
| 45 | - | |||||||||||||
| 46 | - | |||||||||||||
| 47 | - | |||||||||||||
| 48 | - | |||||||||||||
| 49 | - | |||||||||||||
| 50 | __attribute__((visibility("default"))) double qQNaN() { return executed 64 times by 6 tests:   qt_qnan();return qt_qnan();Executed by: 
 executed 64 times by 6 tests:   }return qt_qnan();Executed by: 
  | 64 | ||||||||||||
| 51 | - | |||||||||||||
| 52 | - | |||||||||||||
| 53 | - | |||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | __attribute__((visibility("default"))) double qInf() { return executed 158 times by 9 tests:   qt_inf();return qt_inf();Executed by: 
 executed 158 times by 9 tests:   }return qt_inf();Executed by: 
  | 158 | ||||||||||||
| 57 | - | |||||||||||||
| 58 | - | |||||||||||||
| 59 | - | |||||||||||||
| 60 | - | |||||||||||||
| 61 | - | |||||||||||||
| 62 | - | |||||||||||||
| 63 | static inline quint32 f2i(float f) | - | ||||||||||||
| 64 | { | - | ||||||||||||
| 65 | quint32 i; | - | ||||||||||||
| 66 | memcpy(&i, &f, sizeof(f)); | - | ||||||||||||
| 67 |     return executed 23 times by 1 test:   i;return i;Executed by: 
 executed 23 times by 1 test:  return i;Executed by: 
  | 23 | ||||||||||||
| 68 | } | - | ||||||||||||
| 69 | __attribute__((visibility("default"))) quint32 qFloatDistance(float a, float b) | - | ||||||||||||
| 70 | { | - | ||||||||||||
| 71 | static const quint32 smallestPositiveFloatAsBits = 0x00000001; | - | ||||||||||||
| 72 | - | |||||||||||||
| 73 | - | |||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | static_assert(bool(sizeof(quint32) == sizeof(float)), "sizeof(quint32) == sizeof(float)"); | - | ||||||||||||
| 77 | ((!(qIsFinite(a) && qIsFinite(b))) ? qt_assert("qIsFinite(a) && qIsFinite(b)",__FILE__,146) : qt_noop()); | - | ||||||||||||
| 78 |     if (a == b
  | 1-21 | ||||||||||||
| 79 |         return executed 1 time by 1 test:   0;return 0;Executed by: 
 executed 1 time by 1 test:  return 0;Executed by: 
  | 1 | ||||||||||||
| 80 |     if ((
 
  | 4-17 | ||||||||||||
| 81 | - | |||||||||||||
| 82 |         if (a < 0
  | 0-4 | ||||||||||||
| 83 |             a = -a; executed 4 times by 1 test:  a = -a;Executed by: 
  | 4 | ||||||||||||
| 84 | else | - | ||||||||||||
| 85 |             b = -b; never executed:  b = -b; | 0 | ||||||||||||
| 86 |         return executed 4 times by 1 test:   qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b);return qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b);Executed by: 
 executed 4 times by 1 test:  return qFloatDistance(0.0F, a) + qFloatDistance(0.0F, b);Executed by: 
  | 4 | ||||||||||||
| 87 | } | - | ||||||||||||
| 88 |     if (a < 0
  | 2-15 | ||||||||||||
| 89 | a = -a; | - | ||||||||||||
| 90 | b = -b; | - | ||||||||||||
| 91 |     } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||
| 92 | - | |||||||||||||
| 93 | - | |||||||||||||
| 94 | - | |||||||||||||
| 95 |     if (!a
  | 6-11 | ||||||||||||
| 96 |         return executed 11 times by 1 test:   f2i(b) - smallestPositiveFloatAsBits + 1;return f2i(b) - smallestPositiveFloatAsBits + 1;Executed by: 
 executed 11 times by 1 test:  return f2i(b) - smallestPositiveFloatAsBits + 1;Executed by: 
  | 11 | ||||||||||||
| 97 |     if (!b
  | 0-6 | ||||||||||||
| 98 |         return never executed:   f2i(a) - smallestPositiveFloatAsBits + 1;return f2i(a) - smallestPositiveFloatAsBits + 1;never executed:  return f2i(a) - smallestPositiveFloatAsBits + 1; | 0 | ||||||||||||
| 99 | - | |||||||||||||
| 100 | - | |||||||||||||
| 101 |     return executed 6 times by 1 test:   a > breturn a > b ? f2i(a) - f2i(b) : f2i(b) - f2i(a);Executed by: 
 
 executed 6 times by 1 test:  return a > b ? f2i(a) - f2i(b) : f2i(b) - f2i(a);Executed by: 
  | 1-6 | ||||||||||||
| 102 | } | - | ||||||||||||
| 103 | - | |||||||||||||
| 104 | - | |||||||||||||
| 105 | - | |||||||||||||
| 106 | - | |||||||||||||
| 107 | - | |||||||||||||
| 108 | static inline quint64 d2i(double d) | - | ||||||||||||
| 109 | { | - | ||||||||||||
| 110 | quint64 i; | - | ||||||||||||
| 111 | memcpy(&i, &d, sizeof(d)); | - | ||||||||||||
| 112 |     return executed 23 times by 1 test:   i;return i;Executed by: 
 executed 23 times by 1 test:  return i;Executed by: 
  | 23 | ||||||||||||
| 113 | } | - | ||||||||||||
| 114 | __attribute__((visibility("default"))) quint64 qFloatDistance(double a, double b) | - | ||||||||||||
| 115 | { | - | ||||||||||||
| 116 | static const quint64 smallestPositiveFloatAsBits = 0x1; | - | ||||||||||||
| 117 | - | |||||||||||||
| 118 | - | |||||||||||||
| 119 | - | |||||||||||||
| 120 | - | |||||||||||||
| 121 | static_assert(bool(sizeof(quint64) == sizeof(double)), "sizeof(quint64) == sizeof(double)"); | - | ||||||||||||
| 122 | ((!(qIsFinite(a) && qIsFinite(b))) ? qt_assert("qIsFinite(a) && qIsFinite(b)",__FILE__,204) : qt_noop()); | - | ||||||||||||
| 123 |     if (a == b
  | 1-21 | ||||||||||||
| 124 |         return executed 1 time by 1 test:   0;return 0;Executed by: 
 executed 1 time by 1 test:  return 0;Executed by: 
  | 1 | ||||||||||||
| 125 |     if ((
 
  | 4-17 | ||||||||||||
| 126 | - | |||||||||||||
| 127 |         if (a < 0
  | 0-4 | ||||||||||||
| 128 |             a = -a; executed 4 times by 1 test:  a = -a;Executed by: 
  | 4 | ||||||||||||
| 129 | else | - | ||||||||||||
| 130 |             b = -b; never executed:  b = -b; | 0 | ||||||||||||
| 131 |         return executed 4 times by 1 test:   qFloatDistance(0.0, a) + qFloatDistance(0.0, b);return qFloatDistance(0.0, a) + qFloatDistance(0.0, b);Executed by: 
 executed 4 times by 1 test:  return qFloatDistance(0.0, a) + qFloatDistance(0.0, b);Executed by: 
  | 4 | ||||||||||||
| 132 | } | - | ||||||||||||
| 133 |     if (a < 0
  | 2-15 | ||||||||||||
| 134 | a = -a; | - | ||||||||||||
| 135 | b = -b; | - | ||||||||||||
| 136 |     } executed 2 times by 1 test:  end of blockExecuted by: 
  | 2 | ||||||||||||
| 137 | - | |||||||||||||
| 138 | - | |||||||||||||
| 139 | - | |||||||||||||
| 140 |     if (!a
  | 6-11 | ||||||||||||
| 141 |         return executed 11 times by 1 test:   d2i(b) - smallestPositiveFloatAsBits + 1;return d2i(b) - smallestPositiveFloatAsBits + 1;Executed by: 
 executed 11 times by 1 test:  return d2i(b) - smallestPositiveFloatAsBits + 1;Executed by: 
  | 11 | ||||||||||||
| 142 |     if (!b
  | 0-6 | ||||||||||||
| 143 |         return never executed:   d2i(a) - smallestPositiveFloatAsBits + 1;return d2i(a) - smallestPositiveFloatAsBits + 1;never executed:  return d2i(a) - smallestPositiveFloatAsBits + 1; | 0 | ||||||||||||
| 144 | - | |||||||||||||
| 145 | - | |||||||||||||
| 146 |     return executed 6 times by 1 test:   a > breturn a > b ? d2i(a) - d2i(b) : d2i(b) - d2i(a);Executed by: 
 
 executed 6 times by 1 test:  return a > b ? d2i(a) - d2i(b) : d2i(b) - d2i(a);Executed by: 
  | 1-6 | ||||||||||||
| 147 | } | - | ||||||||||||
| 148 | - | |||||||||||||
| 149 | - | |||||||||||||
| 150 | - | |||||||||||||
| Switch to Source code | Preprocessed file |