import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const here = path.dirname(fileURLToPath(import.meta.url)); export const fixture = JSON.parse(fs.readFileSync(path.join(here, "fixtures", "python_reference.json"), "utf8")); export function maxAbsDiff(a: ArrayLike, b: ArrayLike): number { let m = 0; for (let i = 0; i < a.length; i++) m = Math.max(m, Math.abs(a[i] - b[i])); return m; } export function maxAbs(a: ArrayLike): number { let m = 0; for (let i = 0; i < a.length; i++) m = Math.max(m, Math.abs(a[i])); return m; }