tiny.simd.randomNormalizedFloat
Defined in random.
Source
Source: lib/simd/src/random.zig:319
zig
pub fn randomNormalizedFloat(stream: *RngStream) f32 { const exponent = @as(u32, @bitCast(@as(f32, 1))); const mantissa = @as(u32, @truncate(stream.next())) & 0x007f_ffff; const value: f32 = @bitCast(exponent | mantissa); std.debug.assert(value >= 1); std.debug.assert(value < 2); const result = (2 * (value - 1)) - 1; std.debug.assert(result >= -1); std.debug.assert(result < 1); return result;}Source: lib/simd/src/root.zig:513
zig
pub const randomNormalizedFloat = random.randomNormalizedFloat;Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |