mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-11 02:03:59 +08:00
Float16Array is a native typed-array kind with IEEE 754 binary16 storage. Stores round the number to nearest-even in one step from the double, as Node does, including overflow to Infinity, subnormals, -0 and NaN; reads widen exactly. The runtime converts with integer operations, so no target needs half-precision hardware or compiler-rt support. Construction, element reads and writes, ArrayBuffer views, fill, set, subarray, slice, both sort orders, constructor values and checked-dynamic storage work as for the other typed arrays. Math.f16round, DataView.prototype.getFloat16 and setFloat16, and util.types.isFloat16Array compile.