GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71769
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rand1.c File Reference
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/gmath.h>
Include dependency graph for rand1.c:

Go to the source code of this file.

Functions

float G_math_rand (void)
 
void G_math_srand (int seed)
 Seed the pseudo-random number generator. More...
 
int G_math_srand_auto (void)
 Seed the pseudo-random number generator from the time and PID. More...
 

Function Documentation

float G_math_rand ( void  )

Definition at line 17 of file rand1.c.

References G_drand48().

Referenced by G_math_rand_gauss().

void G_math_srand ( int  seed)

Seed the pseudo-random number generator.

Parameters
seedval32-bit integer used to seed the PRNG

Definition at line 28 of file rand1.c.

References G_srand48().

int G_math_srand_auto ( void  )

Seed the pseudo-random number generator from the time and PID.

Returns
generated seed value passed to G_srand48()

Definition at line 39 of file rand1.c.

References G_srand48_auto().