UNPKG

@thi.ng/vectors

Version:

Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts

10 lines (9 loc) 271 B
import { clamp as _clamp } from "@thi.ng/math/interval"; import { defHofOp } from "./compile/emit.js"; const [clampN, clampN2, clampN3, clampN4] = defHofOp(_clamp, ([o, a]) => `${o}=op(${a},n,m);`, "o,a,n,m", "o,a"); export { clampN, clampN2, clampN3, clampN4 };