summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-06-21 12:58:31 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2021-11-17 14:29:19 +0300
commita74acca858b5d2f8ee07d6e0cb521dbcdce1e5f0 (patch)
treed7840a27ff057a9345cca8830f884ab3ee5435b1 /core/math
parent3c04522ece1cedccdd1d5fff919a5d4e223bed50 (diff)
Expose `randfn` to global scope
Diffstat (limited to 'core/math')
-rw-r--r--core/math/math_funcs.cpp4
-rw-r--r--core/math/math_funcs.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp
index bbed257f60..2b6d92fe0e 100644
--- a/core/math/math_funcs.cpp
+++ b/core/math/math_funcs.cpp
@@ -53,6 +53,10 @@ uint32_t Math::rand() {
return default_rand.rand();
}
+double Math::randfn(double mean, double deviation) {
+ return default_rand.randfn(mean, deviation);
+}
+
int Math::step_decimals(double p_step) {
static const int maxn = 10;
static const double sd[maxn] = {
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index e3b990d48f..8df45255c9 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -318,6 +318,7 @@ public:
static uint32_t rand();
static _ALWAYS_INLINE_ double randd() { return (double)rand() / (double)Math::RANDOM_32BIT_MAX; }
static _ALWAYS_INLINE_ float randf() { return (float)rand() / (float)Math::RANDOM_32BIT_MAX; }
+ static double randfn(double mean, double deviation);
static double random(double from, double to);
static float random(float from, float to);