int cvar_next_value(void *cvar_handle, double *value) { handle_t *h = (handle_t *) cvar_handle; if (!h) { cvar_trace("NULL cvar_handle"); return -1; } if (!value) { cvar_trace("NULL value"); return -1; } *value = rds_exponential(&h->state, h->mean); return 0; }
/* * Generate an exponential distribution with the given mean. */ double rd_exponential( double mean) /* Mean of generated distribution */ { return rds_exponential (&mt_default_state, mean); }