diff options
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index 23230a6..8a4789a 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -76,13 +76,15 @@ static float SC_cosf_fast(float x) { 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) { |