Allocation API update.
Change-Id: I9b4a71f9e94c7d3978f06b7971051ab4f8472503
diff --git a/rsScriptC_Lib.cpp b/rsScriptC_Lib.cpp
index 7e4a247..f61b983 100644
--- a/rsScriptC_Lib.cpp
+++ b/rsScriptC_Lib.cpp
@@ -73,12 +73,14 @@
static float SC_randf(float max) {
float r = (float)rand();
- return r / RAND_MAX * max;
+ r *= max;
+ return r / RAND_MAX;
}
static float SC_randf2(float min, float max) {
float r = (float)rand();
- return r / RAND_MAX * (max - min) + min;
+ r = r * (max - min) + min;
+ return r / RAND_MAX;
}
static int SC_randi(int max) {