Expand description
vM(t, n, e, r, g) โ linear remap from [n, e] to [r, g],
Math.floor-rounded. JS reference:
function vM(t, n, e, r, g) {
return Math.floor((t - n) / (e - n) * (g - r) + r);
}All call sites we observe pass non-negative integers and n < e,
so the integer-cast path is exact; we still go through f64 to
match JS rounding when intermediate products overflow u32.