GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-847944e18e
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

◆ G_math_rand()

float G_math_rand ( void  )

Definition at line 16 of file rand1.c.

References G_drand48().

Referenced by G_math_rand_gauss().

◆ G_math_srand()

void G_math_srand ( int  seed)

Seed the pseudo-random number generator.

Parameters
seedval32-bit integer used to seed the PRNG

Definition at line 27 of file rand1.c.

References G_srand48().

◆ G_math_srand_auto()

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 38 of file rand1.c.

References G_srand48_auto().