MCPcopy Create free account
hub / github.com/esengine/esengine / next

Method next

packages/procgen/src/random/SeededRandom.ts:65–75  ·  view source on GitHub ↗

* @zh 生成下一个随机数 [0, 1) * @en Generate next random number [0, 1)

()

Source from the content-addressed store, hash-verified

63 * @en Generate next random number [0, 1)
64 */
65 next(): number {
66 let s1 = this._s0;
67 const s0 = this._s1;
68 this._s0 = s0;
69 s1 ^= s1 << 23;
70 s1 ^= s1 >>> 17;
71 s1 ^= s0;
72 s1 ^= s0 >>> 26;
73 this._s1 = s1;
74 return ((this._s0 + this._s1) >>> 0) / 4294967296;
75 }
76
77 /**
78 * @zh 生成整数 [min, max]

Callers 15

constructorMethod · 0.95
resetMethod · 0.95
nextIntMethod · 0.95
nextFloatMethod · 0.95
nextBoolMethod · 0.95
nextGaussianMethod · 0.95
nextExponentialMethod · 0.95
nextPointInCircleMethod · 0.95
nextPointOnCircleMethod · 0.95
nextPointInSphereMethod · 0.95
nextDirection2DMethod · 0.95
executeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected