MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / randomInt

Function randomInt

apps/web/src/scripts/usage/benchmark-insert-usage.ts:38–40  ·  view source on GitHub ↗
(avg: number, min = 0, max = avg * 3)

Source from the content-addressed store, hash-verified

36}
37
38function randomInt(avg: number, min = 0, max = avg * 3): number {
39 return Math.max(min, Math.min(max, Math.round(avg + (Math.random() - 0.5) * (max - min))));
40}
41
42function randomCoordinate(min: number, max: number): number {
43 return min + (secureRandomInt(0, 1_000_000) / 1_000_000) * (max - min);

Callers 1

generateRandomRecordFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected