Float16 module

vector4_float16

procedure · 1 overloadSource

Converts a Math.Vector4 to half precision, rounding each component as float_to_half_fast3 does.

ExampleOpen in playground ↗
#import "Math";
h := vector4_float16(xyzw(1, 2, 3, 70000));
assert(float16_to_float32(h.w) > 1e30); // 70000 overflows to infinity
assert(float16_to_float32(h.y) == 2);
vector4_float16 :: (v: Vector4) -> Vector4_Float16

Parameters

Returns

See also