v135 · javascript / typed arrays
Precision Visualizer
Explore the precision gaps between Float16Array (fp16) and Float32Array (fp32). Enter a value, see both representations, the rounding error, the bit layout, and compare memory footprints for ML weight tensors of different sizes.
checking Float16Array…
Float16Array uses 2 bytes per element (5-bit exponent, 10-bit mantissa) vs Float32Array's 4 bytes. Precision is ~3 significant decimal digits; range is roughly ±65504. This is sufficient for ML model weights and GPU data, halving memory while sacrificing precision for large/small values.
Quick scenarios
Enter a value
Float16 vs Float32 comparison
Precision number line (±2 range around input)
Float32 representable values
Float16 representable values (gaps visible)
Memory footprint — ML weight tensor