Dtype.f16_up: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/dtype.bend as Dtype Lines 107-115 of bendtorch@1.3.0.0/dtype.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/dtype.bend&start_line=107&end_line=115 import Base # F16 -> F32, exact. A subnormal is m ยท 2^-24: the product of two F32 numbers that is exact and normal. def f16_up(zero: Bool, top: Bool, +m: U32, +s: U32, +eu: U32) -> F32: match zero top: case True{} _: u2f((s .|. f2u((U32.to_f32(m) * 0.000000059604644775390625 : F32)) : U32)) case False{} True{}: u2f((((s .|. 2139095040 : U32) .|. U32.shln(m, 13n) : U32) .|. pick_u(U32.is_eq(m, 0), 0, 4194304) : U32)) case False{} False{}: u2f(((s .|. U32.shln((eu + 112 : U32), 23n) : U32) .|. U32.shln(m, 13n) : U32)) Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.shln https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_f32 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/dtype.bend&name=f2u https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/dtype.bend&name=pick_u https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/dtype.bend&name=u2f