Float32
The Float32 module provides functions for working with 32-bit (single-precision) floating-point numbers. Use Float32 for graphics, audio processing, GPU computation, and memory-constrained applications where 64-bit precision is not required.
Kit's default Float type is 64-bit (double precision). Use Float32
when memory efficiency matters, when interfacing with graphics/audio APIs, or when working with
SIMD operations that benefit from 32-bit floats.
Overview
Float32 follows the IEEE 754 single-precision format with approximately 7 decimal digits of precision. The range is approximately ±3.4 × 10^38.
Creation
f = Float32.from-float 3.14159
println f
Arithmetic
Float32 supports the same arithmetic operations as Float:
add, sub, mul, div, and neg.