MCPcopy Create free account
hub / github.com/apache/cloudberry / sampler_random_fract

Function sampler_random_fract

src/backend/utils/misc/sampling.c:320–331  ·  view source on GitHub ↗

Select a random value R uniformly distributed in (0 - 1) */

Source from the content-addressed store, hash-verified

318
319/* Select a random value R uniformly distributed in (0 - 1) */
320double
321sampler_random_fract(SamplerRandomState randstate)
322{
323 double res;
324
325 /* pg_erand48 returns a value in [0.0 - 1.0), so we must reject 0 */
326 do
327 {
328 res = pg_erand48(randstate);
329 } while (res == 0.0);
330 return res;
331}
332
333
334/*

Callers 13

analyze_row_processorFunction · 0.85
file_acquire_sample_rowsFunction · 0.85
random_relative_primeFunction · 0.85
random_relative_primeFunction · 0.85
BlockSampler_NextFunction · 0.85
RowSampler_NextFunction · 0.85
reservoir_get_next_SFunction · 0.85
anl_random_fractFunction · 0.85
anl_init_selection_stateFunction · 0.85

Calls 1

pg_erand48Function · 0.85

Tested by

no test coverage detected