MCPcopy Create free account
hub / github.com/SIPp/sipp / CUniform

Method CUniform

src/stat.cpp:1577–1585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1575/* Implementation of a uniform distribution. */
1576static bool uniform_init = false;
1577CUniform::CUniform(double min, double max)
1578{
1579 if (!uniform_init) {
1580 uniform_init = true;
1581 srand(time(nullptr));
1582 }
1583 this->min = min;
1584 this->max = max;
1585}
1586double CUniform::sample()
1587{
1588 double rval = ((double)rand())/((double)RAND_MAX);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected