Generates rationals in [0, 1)
| 90 | |
| 91 | // Generates rationals in [0, 1) |
| 92 | double getDouble01(uint *val, uint index) { |
| 93 | uintl v = transform<uintl>(val, index); |
| 94 | constexpr double factor = |
| 95 | ((1.0) / (std::numeric_limits<unsigned long long>::max() + |
| 96 | static_cast<long double>(1.0l))); |
| 97 | constexpr double half_factor((0.5) * factor); |
| 98 | return fma(v, factor, half_factor); |
| 99 | } |
| 100 | |
| 101 | template<> |
| 102 | char transform<char>(uint *val, uint index) { |
no test coverage detected