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

Function get_random_uint64

src/tools/testint128.c:68–78  ·  view source on GitHub ↗

* Get a random uint64 value. * We don't assume random() is good for more than 16 bits. */

Source from the content-addressed store, hash-verified

66 * We don't assume random() is good for more than 16 bits.
67 */
68static uint64
69get_random_uint64(void)
70{
71 uint64 x;
72
73 x = (uint64) (random() & 0xFFFF) << 48;
74 x |= (uint64) (random() & 0xFFFF) << 32;
75 x |= (uint64) (random() & 0xFFFF) << 16;
76 x |= (uint64) (random() & 0xFFFF);
77 return x;
78}
79
80/*
81 * Main program.

Callers 1

mainFunction · 0.85

Calls 1

randomFunction · 0.85

Tested by

no test coverage detected