MCPcopy Create free account
hub / github.com/VcDevel/Vc / rnd

Function rnd

tests/casts.cpp:144–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142// rnd {{{1
143template <typename To, typename From>
144static 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}
152template <typename To, typename From>
153static Vc::enable_if<(!Vc::Traits::is_floating_point<From>::value), From> rnd()
154{

Callers

nothing calls this directly

Calls 4

isnanFunction · 0.85
setZeroMethod · 0.80
TFunction · 0.50
maxFunction · 0.50

Tested by

no test coverage detected