GRASS Programmer's Manual
6.5.svn(2014)-r66266
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
rand1.c
Go to the documentation of this file.
1
#include <grass/config.h>
2
#include <stdlib.h>
3
#include <grass/gmath.h>
4
5
17
float
G_math_rand
(
int
seed)
18
{
19
#if defined(HAVE_DRAND48)
20
if
(seed < 0)
21
srand48(-seed);
22
23
return
(
float
)drand48();
24
#else
25
if
(seed < 0)
26
srand(-seed);
27
28
return
1.0f * rand() / RAND_MAX;
29
#endif
30
}
G_math_rand
float G_math_rand(int seed)
Random Number Generator (Uniform)
Definition:
rand1.c:17
lib
gmath
rand1.c
Generated on Sat Jan 2 2016 01:46:49 for GRASS Programmer's Manual by
1.8.5