diff options
| author | 2011-04-27 17:36:38 -0700 | |
|---|---|---|
| committer | 2011-04-27 17:36:38 -0700 | |
| commit | 697f8b331bb339e4db716efbb96e2182aac40255 (patch) | |
| tree | 28bce3916e2a2803fbc43b0891bf9f521e9bcc53 /libs | |
| parent | 969749319ca17f6e0c6836303a78cc484df2539b (diff) | |
| parent | 00df8e230ef797729a3618d1d0c19cda3950c922 (diff) | |
am 00df8e23: Merge "Check setName() for null string + fix rsRand()." into honeycomb-mr1
* commit '00df8e230ef797729a3618d1d0c19cda3950c922':
Check setName() for null string + fix rsRand().
Diffstat (limited to 'libs')
| -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 23230a630809..8a4789ab1f3f 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) { |