| 88 | |
| 89 | |
| 90 | int getRandomInt(int min, int maxExcl) { |
| 91 | DEMAND( maxExcl >= min ); |
| 92 | |
| 93 | // permit this out of convenience |
| 94 | // for some test generators |
| 95 | if (min == maxExcl) |
| 96 | return min; |
| 97 | |
| 98 | qreal r = std::floor(getRandomReal(min, maxExcl)); |
| 99 | int out = static_cast<int>(r); |
| 100 | |
| 101 | DEMAND( out >= min ); |
| 102 | DEMAND( out < maxExcl ); |
| 103 | return out; |
| 104 | } |
| 105 | |
| 106 | |
| 107 | qcomp getRandomComplex() { |
no test coverage detected