import mir.ndslice : sliced; static immutable eps = 1e-6; static immutable _a = [1.0, 0.0, 0.0, 1.0]; auto a = _a.sliced(2, 2); static immutable _b = [1.0, eps, -eps, 1.0]; auto b = _b.sliced(2, 2); assert(approxEqual(a, b, eps*2, eps*2)); assert(!approxEqual(a, b, eps/2, eps/2));
testing function for float-point slices