summaryrefslogtreecommitdiffstats
path: root/libs/rs
diff options
context:
space:
mode:
Diffstat (limited to 'libs/rs')
-rw-r--r--libs/rs/driver/rsdRuntimeMath.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/rs/driver/rsdRuntimeMath.cpp b/libs/rs/driver/rsdRuntimeMath.cpp
index bd1fd0e..093e311 100644
--- a/libs/rs/driver/rsdRuntimeMath.cpp
+++ b/libs/rs/driver/rsdRuntimeMath.cpp
@@ -243,13 +243,15 @@ static void SC_MatrixTranspose_2x2(Matrix2x2 *m) {
static float SC_randf(float max) {
float r = (float)rand();
r *= max;
- return r / RAND_MAX;
+ r /= RAND_MAX;
+ return r;
}
static float SC_randf2(float min, float max) {
float r = (float)rand();
+ r /= RAND_MAX;
r = r * (max - min) + min;
- return r / RAND_MAX;
+ return r;
}
static int SC_randi(int max) {