.TH "kdbrand.h" 3elektra "Fri Aug 4 2023" "Version 0.11.0" "Elektra" \" -*- nroff -*-
.ad l
.nh
.SH NAME
kdbrand.h \- Defines for Rand\&.  

.SH SYNOPSIS
.br
.PP
\fC#include <stdint\&.h>\fP
.br

.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBelektraRand\fP (int32_t *seed)"
.br
.RI "Non cryptographic pseudo random number generator\&. "
.ti -1c
.RI "int32_t \fBelektraRandGetInitSeed\fP (void)"
.br
.RI "Random initial seed generator\&. "
.in -1c
.SH "Detailed Description"
.PP 
Defines for Rand\&. 


.PP
\fBCopyright\fP
.RS 4
BSD License (see doc/COPYING or https://www.libelektra.org) 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "void elektraRand (int32_t * seed)"

.PP
Non cryptographic pseudo random number generator\&. By Ray Gardner www8\&.cs\&.umu\&.se/~isak/snippets/rg_rand\&.c
.PP
based on 'Random Number Generators: Good Ones Are Hard to Find', S\&.K\&. Park and K\&.W\&. Miller, Communications of the ACM 31:10 (Oct 1988), and 'Two Fast Implementations of the 'Minimal Standard' Random
Number Generator', David G\&. Carta, Comm\&. ACM 33, 1 (Jan 1990), p\&. 87-88
.PP
linear congruential generator f(z) = 16807 z mod (2 ** 31 - 1)
.PP
uses L\&. Schrage's method to avoid overflow problems
.PP
Make sure the initial seed is: 0 < seed < ELEKTRARANDMAX
.PP
\fBParameters\fP
.RS 4
\fIseed\fP a pointer to the seed 
.RE
.PP

.SS "int32_t elektraRandGetInitSeed (void)"

.PP
Random initial seed generator\&. Generates a random initial seed for the \fCelektraRand (\&.\&.\&.)\fP function\&. Two invocations in the same second return the same random initial seed, due to the usage of \fCtime (0)\fP\&.
.PP
\fBReturn values\fP
.RS 4
\fIrandom\fP initial seed 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for Elektra from the source code\&.
