| 142 | // rnd {{{1 |
| 143 | template <typename To, typename From> |
| 144 | static Vc::enable_if<(Vc::Traits::is_floating_point<From>::value), From> rnd() |
| 145 | { |
| 146 | using T = typename From::value_type; |
| 147 | auto r = (From::Random() - T(0.5)) * |
| 148 | T(std::numeric_limits<typename To::value_type>::max()); |
| 149 | r.setZero(isnan(r)); |
| 150 | return r; |
| 151 | } |
| 152 | template <typename To, typename From> |
| 153 | static Vc::enable_if<(!Vc::Traits::is_floating_point<From>::value), From> rnd() |
| 154 | { |