MCPcopy Create free account
hub / github.com/Effect-TS/effect / nextInt32

Function nextInt32

packages/effect/src/Random.ts:504–510  ·  view source on GitHub ↗

* Returns a signed, random integer in the range [-2^31, 2^31).

()

Source from the content-addressed store, hash-verified

502 * Returns a signed, random integer in the range [-2^31, 2^31).
503 */
504 function nextInt32(): number {
505 if (!generation--) {
506 pnrg()
507 generation = 255
508 }
509 return result[generation]
510 }
511
512 function nextIntUnsafe(): number {
513 return Math.floor(nextDoubleUnsafe() * (Number.MAX_SAFE_INTEGER - Number.MIN_SAFE_INTEGER + 1)) +

Callers 1

nextDoubleUnsafeFunction · 0.85

Calls 1

pnrgFunction · 0.85

Tested by

no test coverage detected