Modular C
C◼lib◼rand◼uni: symbols inserted from C◼snippet◼uniform.
+ Collaboration diagram for C◼lib◼rand◼uni: symbols inserted from C◼snippet◼uniform.:
C◼lib◼rand◼type C◼lib◼rand◼uniform (void)
 Transform a discrete uniform distribution on positive integers $[0, MAX]$ to a floating point uniform distribution on the interval $[0, 1)$. More...
 

Detailed Description

See also
C◼snippet◼uniform snippet: identifiers inserted directly to an importer for details
This import uses the following slot(s)
slotreplacement
C◼snippet◼uniform◼typeC◼lib◼rand◼type
C◼snippet◼uniform◼MAXC◼lib◼rand◼MAX

Function Documentation

§ C◼lib◼rand◼uniform()

C◼lib◼rand◼type C◼lib◼rand◼uniform ( void  )
inline

Transform a discrete uniform distribution on positive integers $[0, MAX]$ to a floating point uniform distribution on the interval $[0, 1)$.

Definition at line 216 of file C-lib-rand.c.

References C◼lib◼rand(), C◼lib◼rand◼MAX, C◼MODULE_ABI, and C◼MODULE_FEATURES.

216  {
217 #line 21 "/home/gustedt/build/cmod/C/C-snippet-uniform.X"
218  return C◼lib◼rand()/(C◼lib◼rand◼MAX+1.0);
219 }
#define C◼lib◼rand◼MAX
The platform specific value RAND_MAX.
int C◼lib◼rand(void)
This aliases symbol rand.
+ Here is the call graph for this function: