We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07cf37a commit f085ad2Copy full SHA for f085ad2
lib/node_modules/@stdlib/math/base/special/vercosf/benchmark/c/native/benchmark.c
@@ -75,13 +75,15 @@ static double tic( void ) {
75
}
76
77
/**
78
-* Generates a random number on the interval [0,1).
+* Generates a random number on the interval [min,max).
79
*
80
-* @return random number
+* @param min minimum value (inclusive)
81
+* @param max maximum value (exclusive)
82
+* @return random number
83
*/
-static double rand_double( void ) {
- int r = rand();
84
- return (double)r / ( (double)RAND_MAX + 1.0 );
+static float random_uniform( const float min, const float max ) {
85
+ float v = (float)rand() / ( (float)RAND_MAX + 1.0f );
86
+ return min + ( v*(max-min) );
87
88
89
0 commit comments