GRASS GIS 7 Programmer's Manual  7.0.4(2016)-r00000
rand1.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <grass/gis.h>
3 #include <grass/gmath.h>
4 
5 
17 float G_math_rand(void)
18 {
19  return G_drand48();
20 }
21 
28 void G_math_srand(int seed)
29 {
30  G_srand48(seed);
31 }
32 
40 {
41  return (int) G_srand48_auto();
42 }
void G_srand48(long seedval)
Seed the pseudo-random number generator.
Definition: lrand48.c:53
void G_math_srand(int seed)
Seed the pseudo-random number generator.
Definition: rand1.c:28
float G_math_rand(void)
Definition: rand1.c:17
int G_math_srand_auto(void)
Seed the pseudo-random number generator from the time and PID.
Definition: rand1.c:39
long G_srand48_auto(void)
Seed the pseudo-random number generator from the time and PID.
Definition: lrand48.c:71
double G_drand48(void)
Generate a floating-point value in the range [0,1)
Definition: lrand48.c:151