A Float32Array stores numbers in single precision. Projecting records into it can change a decimal value even when the projected field was a number.
Worked example
type Sample = { time: number; value: number };
const samples: Sample[] = [
{ time: 1, value: 2 },
{ time: 2, value: 6 },
{ time: 4, value: 10 },
];
console.log(Float32Array.from(samples, (s) => s.value).join(","));Result
2,6,10Implementation notes
Typed arrays trade flexibility for a fixed element representation. Retain identifiers separately if later work must map numerical positions back to source records.
Try it yourself
Compare a decimal before and after the typed-array conversion.
Open the TypeScript example →Editorial date June 25, 2026 · Published December 6, 2026