test/f16_all.bend source
test/f16_all.bend on the hub · documented module
# Prints V.f16(h) for every 16-bit h, one a line; check_f16_all.py compares them with NumPy's float16 -> float32.import Baseimport ../widen.bend as V@unsafedef go(done: Bool, +h: U32) -> IO(Unit): match done: case True{}: IO.pure(Unit, Unit{}) case False{}: do IO<Unit>: IO.print(U32.show(V.f16(h))) go(U32.is_eq(h, 65535), (h + 1 : U32))@unsafedef main() -> IO(Unit): go(False{}, 0)