Loading...
Searching...
No Matches
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.
int | G_math_srand_auto (void)
| Seed the pseudo-random number generator from the time and PID.

## Function Documentation

## G_math_rand()

float G_math_rand | ( | void |  | ) |

Definition at line 15 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

  [in] | seed | 32-bit integer used to seed the PRNG

Definition at line 25 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 35 of file rand1.c.

References G_srand48_auto().