Download .opencode/node_modules/pure-rand/lib/distribution/uniformFloat32.js from Chenloong999/opencode-data: direct link, hf CLI and curl.
- Browser
- Download file 578 Bytes
-
https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/pure-rand/lib/distribution/uniformFloat32.js
- Command line
-
hf download hf://datasets/Chenloong999/opencode-data/.opencode/node_modules/pure-rand/lib/distribution/uniformFloat32.js
-
curl -L -o uniformFloat32.js https://huggingface.co/datasets/Chenloong999/opencode-data/resolve/main/.opencode/node_modules/pure-rand/lib/distribution/uniformFloat32.js
578 Bytes
| Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); | |
| //#region src/distribution/uniformFloat32.ts | |
| const scale = 5.960464477539063e-8; | |
| const mask = 16777215; | |
| /** | |
| * Uniformly generate random 32-bit floating point values between 0 (included) and 1 (excluded) | |
| * | |
| * @remarks Generated values are multiples of 2**-24, providing 24 bits of randomness. | |
| * | |
| * @param rng - Instance of RandomGenerator to extract random values from | |
| * | |
| * @public | |
| */ | |
| function uniformFloat32(rng) { | |
| return (rng.next() & mask) * scale; | |
| } | |
| //#endregion | |
| exports.uniformFloat32 = uniformFloat32; | |