MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / staticRandomI32Range

Function staticRandomI32Range

source/core/StarStaticRandom.hpp:57–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56template <typename T, typename... TL>
57int32_t staticRandomI32Range(int32_t min, int32_t max, T const& d, TL const&... rest) {
58 uint64_t denom = (uint64_t)(-1) / ((uint64_t)(max - min) + 1);
59 return (int32_t)(staticRandomU64(d, rest...) / denom + min);
60}
61
62template <typename T, typename... TL>
63uint32_t staticRandomU32Range(uint32_t min, uint32_t max, T const& d, TL const&... rest) {

Callers 5

addLayerMethod · 0.85
frontOrbitersMethod · 0.85
staticRandomValueFromFunction · 0.85

Calls 1

staticRandomU64Function · 0.85

Tested by

no test coverage detected