Added normally distributed generation function to RNG

This commit is contained in:
Chaosus
2019-03-14 13:53:08 +03:00
parent 775e74e0d4
commit 5f137925dc
4 changed files with 23 additions and 0 deletions

View File

@ -55,6 +55,8 @@ public:
_FORCE_INLINE_ real_t randf_range(real_t from, real_t to) { return randbase.random(from, to); }
_FORCE_INLINE_ real_t randfn(real_t mean = 0.0, real_t deviation = 1.0) { return randbase.randfn(mean, deviation); }
_FORCE_INLINE_ int randi_range(int from, int to) {
unsigned int ret = randbase.rand();
return ret % (to - from + 1) + from;