MCPcopy Create free account
hub / github.com/defold/defold / get_randf

Method get_randf

engine/dlib/src/basis/encoder/cppspmd_math.h:560–567  ·  view source on GitHub ↗

Returns random numbers between [low, high), or low if low >= high

Source from the content-addressed store, hash-verified

558
559// Returns random numbers between [low, high), or low if low >= high
560inline vfloat spmd_kernel::get_randf(rand_context& x, vfloat low, vfloat high)
561{
562 vint rndi = get_randu(x) & 0x7fffff;
563
564 vfloat rnd = (vfloat)(rndi) * (1.0f / 8388608.0f);
565
566 return spmd_ternaryf(low < high, vfma(high - low, rnd, low), low);
567}
568
569CPPSPMD_FORCE_INLINE void spmd_kernel::init_reverse_bits(vint& tab1, vint& tab2)
570{

Callers

nothing calls this directly

Calls 2

spmd_ternaryfFunction · 0.85
vfmaFunction · 0.85

Tested by

no test coverage detected