MCPcopy Create free account
hub / github.com/TheAlgorithms/C / _random

Function _random

machine_learning/kohonen_som_trace.c:54–58  ·  view source on GitHub ↗

* \brief Helper function to generate a random number in a given interval. * \details * \n Steps: * 1. `r1 = rand() % 100` gets a random number between 0 and 99 * 2. `r2 = r1 / 100` converts random number to be between 0 and 0.99 * 3. scale and offset the random number to given range of \f$[a,b)\f$ * \f[ * y = (b - a) \times \frac{\text{(random number between 0 and RAND_MAX)} \; * \text{mod

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 6

test_circleFunction · 0.70
test1Function · 0.70
test_lamniscateFunction · 0.70
test2Function · 0.70
test_3d_classesFunction · 0.70
test3Function · 0.70

Calls

no outgoing calls

Tested by 3

test_circleFunction · 0.56
test_lamniscateFunction · 0.56
test_3d_classesFunction · 0.56