GRASS Programmer's Manual
6.4.2(2012)
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
}
lib
gmath
rand1.c
Generated on Sun Mar 16 2014 05:07:48 for GRASS Programmer's Manual by
1.8.1.2