Nitpick Floating Point Type Family
Nitpick natively supports standard IEEE 754 floating point numbers, extended precision floats, and deterministic fixed-point variants.
1. Floating Point
(flt)
flt32(Single precision)flt64(Double precision)flt128(Quad precision)flt256,flt512(Extended software/SIMD precision)
Literals: Suffix with the type name
(e.g., 3.14f32, 2.71828f64).
Usage Example:
flt32:pi = 3.14159f32;
flt64:high_precision_val = -10.5f64;
2. Fixed Point
(fix256)
To guarantee absolute determinism across different
architectures (which often have subtly different hardware
FPUs), Nitpick provides a native fixed-point type. *
fix256: A 256-bit fixed point number (128 bits
for the integer part, 128 bits for the fractional part). *
Designed for high-fidelity physics simulations and financial
calculations where rounding errors must be absolutely
identical across all devices.
Literals: Suffix with
fix256 (e.g., 1.0fix256).
Usage Example:
fix256:velocity = 299792458.0fix256;
3. Dimensional Analysis
The compiler supports attaching SI units to the
fix256 type at compile-time to prevent unit
mismatch errors (e.g., adding meters to seconds). *
fix256<Joules> *
fix256<Meters> *
fix256<Seconds> *
fix256<Newtons> *
fix256<Kelvin>
Usage Example:
fix256<Meters>:distance = 100.0fix256;
fix256<Seconds>:time = 9.58fix256;
// Compile error if you tried to assign `distance` to `time`!