Resources Numerical accuracy
Equality comparisons
Where the code asks whether two decimal numbers are exactly equal. A floating-point result can differ from another in the last digit after a few transformations, so a mesh run through several of them can change the length of an edge, or miss a match. Compare with < or > where a range is meant, and with a documented epsilon where equality is.
Equality comparisons
These are places worth checking, not confirmed bugs. The scan reads how the code is written, not what it is meant to do, so some entries are fine as they are: a test against exactly 0 is often a deliberate guard against dividing by zero. It skips text, counts and indexes, and any comparison it cannot be sure involves decimal numbers, so there are likely more in the code than are listed here.
-
Two computed values bimcraft.js:4827 in update BimCraft
for (const p of editor.placer().placements().filter((x) => x.uuid === r.uuid && Number(x.version) === Number(r.version))) {=== in
Number(x.version) === Number(r.version). Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Measurements and typed values in the main window. -
Two computed values compute/parity.js:75 in compareImages BimCraft, ModelCraft
if (ref.w !== test.w || ref.h !== test.h) throw new Error('parity: pictures of different sizes');!== in
ref.w !== test.w. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Statistical comparison of rendered pictures. -
Two computed values compute/parity.js:75 in compareImages BimCraft, ModelCraft
if (ref.w !== test.w || ref.h !== test.h) throw new Error('parity: pictures of different sizes');!== in
ref.h !== test.h. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Statistical comparison of rendered pictures. -
Two computed values exr/exr.js:646 in get BimCraft, ModelCraft
if (c.width === width && c.height === height) return (i) => c.data[i];=== in
c.width === width. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: OpenEXR and Radiance HDR picture files. -
Two computed values exr/exr.js:646 in get BimCraft, ModelCraft
if (c.width === width && c.height === height) return (i) => c.data[i];=== in
c.height === height. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: OpenEXR and Radiance HDR picture files. -
Two computed values ifc/geo-tri.js:55 in ring BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (last && first !== last && last.x === first.x && last.y === first.y) remove(last), (last = last.prev);=== in
last.x === first.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:55 in ring BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (last && first !== last && last.x === first.x && last.y === first.y) remove(last), (last = last.prev);=== in
last.y === first.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:62 in rightmost BimCraft, TakeoffCraft, CivilCraft, DetailCraft
function rightmost(n) { let r = n, p = n; do { if (p.x > r.x || (p.x === r.x && p.y < r.y)) r = p; p = p.next; } while (p !== n); return r; }=== in
p.x === r.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:77 in bridgeHole BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (a.y !== b.y) {!== in
a.y !== b.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:92 in bridgeHole BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (inside && !(p.x === m.x && p.y === m.y)) {=== in
p.x === m.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:92 in bridgeHole BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (inside && !(p.x === m.x && p.y === m.y)) {=== in
p.y === m.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:118 in isEar BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (p.i !== a.i && p.i !== b.i && p.i !== c.i && (p.x !== a.x || p.y !== a.y) && (p.x !== c.x || p.y !== c.y) && (p.x !== b.x || p.y !== b.y) && inTri(a, b, c, p) && cross(p.prev, p, p.next) <= 0) ret!== in
p.x !== a.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:118 in isEar BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (p.i !== a.i && p.i !== b.i && p.i !== c.i && (p.x !== a.x || p.y !== a.y) && (p.x !== c.x || p.y !== c.y) && (p.x !== b.x || p.y !== b.y) && inTri(a, b, c, p) && cross(p.prev, p, p.next) <= 0) ret!== in
p.y !== a.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:118 in isEar BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (p.i !== a.i && p.i !== b.i && p.i !== c.i && (p.x !== a.x || p.y !== a.y) && (p.x !== c.x || p.y !== c.y) && (p.x !== b.x || p.y !== b.y) && inTri(a, b, c, p) && cross(p.prev, p, p.next) <= 0) ret!== in
p.x !== c.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:118 in isEar BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (p.i !== a.i && p.i !== b.i && p.i !== c.i && (p.x !== a.x || p.y !== a.y) && (p.x !== c.x || p.y !== c.y) && (p.x !== b.x || p.y !== b.y) && inTri(a, b, c, p) && cross(p.prev, p, p.next) <= 0) ret!== in
p.y !== c.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:118 in isEar BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (p.i !== a.i && p.i !== b.i && p.i !== c.i && (p.x !== a.x || p.y !== a.y) && (p.x !== c.x || p.y !== c.y) && (p.x !== b.x || p.y !== b.y) && inTri(a, b, c, p) && cross(p.prev, p, p.next) <= 0) ret!== in
p.x !== b.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:118 in isEar BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if (p.i !== a.i && p.i !== b.i && p.i !== c.i && (p.x !== a.x || p.y !== a.y) && (p.x !== c.x || p.y !== c.y) && (p.x !== b.x || p.y !== b.y) && inTri(a, b, c, p) && cross(p.prev, p, p.next) <= 0) ret!== in
p.y !== b.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:153 in between BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if ((a.x === b.x && a.y === b.y) || (c.x === b.x && c.y === b.y)) return false;=== in
a.x === b.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:153 in between BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if ((a.x === b.x && a.y === b.y) || (c.x === b.x && c.y === b.y)) return false;=== in
a.y === b.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:153 in between BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if ((a.x === b.x && a.y === b.y) || (c.x === b.x && c.y === b.y)) return false;=== in
c.x === b.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values ifc/geo-tri.js:153 in between BimCraft, TakeoffCraft, CivilCraft, DetailCraft
if ((a.x === b.x && a.y === b.y) || (c.x === b.x && c.y === b.y)) return false;=== in
c.y === b.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation by ear clipping. -
Two computed values live.js:86 in end BimCraft
if (was && now && was.t === now.t && JSON.stringify(enc(was.p)) === JSON.stringify(enc(now.p))) continue;=== in
was.t === now.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values raster.js:171 in openAsc BimCraft, CivilCraft
gt: [h.xll, h.dx, 0, h.yll + h.nrows * h.dy, 0, -h.dy], pixelIsPoint: false, cell: h.dx === h.dy ? h.dx : null,=== in
h.dx === h.dy. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Elevation grids read from GeoTIFF and ASCII files. -
Two computed values render/anim.js:129 in sortKeys BimCraft, ModelCraft
for (const k of keys) { if (out.length && out[out.length - 1].t === k.t) out[out.length - 1] = k; else out.push(k); }=== in
out[out.length - 1].t === k.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Animation keys, curves and poses. -
Two computed values render/anim.js:467 in moveKeys BimCraft, ModelCraft
for (const k of x.keys) { const last = out[out.length - 1]; if (last && last.t === k.t) { if (moved.has(k) || !moved.has(last)) out[out.length - 1] = k; } else out.push(k); }=== in
last.t === k.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Animation keys, curves and poses. -
Two computed values res-elec.js:238 in changeDevice BimCraft
if (nx.height !== d.height) writeDevice(w, nx, readWalls(w, d.storey));!== in
nx.height !== d.height. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Electrical devices: positions, loads and circuit amps. -
Two computed values res-ui.js:170 in bindRows BimCraft
if (e.target.value === 'spiral' && R.stair.width === STAIR_DEFAULTS.width) R.stair.width = SPIRAL_DEFAULTS.width;=== in
R.stair.width === STAIR_DEFAULTS.width. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Ground read from a survey file, Figures shown in the residential panels and schedules. -
Two computed values res-ui.js:171 in bindRows BimCraft
else if (e.target.value !== 'spiral' && R.stair.width === SPIRAL_DEFAULTS.width) R.stair.width = STAIR_DEFAULTS.width;=== in
R.stair.width === SPIRAL_DEFAULTS.width. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Ground read from a survey file, Figures shown in the residential panels and schedules. -
Two computed values views-ui.js:235 in editCallout BimCraft
scale.value = scalesFor(u).some((x) => x.ratio === c.scale) ? String(c.scale) : '0';=== in
x.ratio === c.scale. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values views-ui.js:348 in rangeFields BimCraft
scale.value = scalesFor(u).some((x) => x.ratio === vals.scale) ? String(vals.scale) : '0';=== in
x.ratio === vals.scale. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values wall-section-graphics.js:165 in cutFaceItems BimCraft
const graphic = c.layers && c.detail==='fine' && scale!==c.scale ? {...c,layers:c.layers.map(l=>({...l,hatch:['diagonal','crosshatch'].includes(l.fill)?l.polys.flatMap(p=>hatchSegments(p,[],l.fill==='!== in
scale!==c.scale. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Wall layers drawn in plans and sections. -
Two computed values addons/cabinet/lib/cutlist/cutlist.js:86 in sameKind CadCraft
const sameKind = (a, b) => a.material === b.material && a.thickness === b.thickness && a.length === b.length && a.width === b.width &&=== in
a.thickness === b.thickness. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values addons/cabinet/lib/cutlist/cutlist.js:86 in sameKind CadCraft
const sameKind = (a, b) => a.material === b.material && a.thickness === b.thickness && a.length === b.length && a.width === b.width &&=== in
a.width === b.width. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values addons/cabinet/lib/draw.js:29 in planEnts CadCraft
for (const f of frontsOf(cab, R).filter((g, i, a) => a.findIndex((h) => h.x === g.x) === i)) out.push(rect(f.x * k, D, f.w * k, F));=== in
h.x === g.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values addons/cabinet/main.js:419 in renderPanel CadCraft
if (cabs.length) facts = t('panel.facts', { n: cabs.length, pieces: cutList(partsOf(cabs.filter((x) => x.d.u === cabs[0].d.u))).pieces });=== in
x.d.u === cabs[0].d.u. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cabinets along a wall line. -
Two computed values addons/cabinetcraft/lib/cutlist/cutlist.js:86 in sameKind CadCraft, BimCraft, ModelCraft, PartCraft
const sameKind = (a, b) => a.material === b.material && a.thickness === b.thickness && a.length === b.length && a.width === b.width &&=== in
a.thickness === b.thickness. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cut list sizes, areas and banding lengths. -
Two computed values addons/cabinetcraft/lib/cutlist/cutlist.js:86 in sameKind CadCraft, BimCraft, ModelCraft, PartCraft
const sameKind = (a, b) => a.material === b.material && a.thickness === b.thickness && a.length === b.length && a.width === b.width &&=== in
a.width === b.width. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cut list sizes, areas and banding lengths. -
Two computed values addons/cabinetcraft/lib/draw.js:29 in planEnts CadCraft, BimCraft, ModelCraft, PartCraft
for (const f of frontsOf(cab, R).filter((g, i, a) => a.findIndex((h) => h.x === g.x) === i)) out.push(rect(f.x * k, D, f.w * k, F));=== in
h.x === g.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cabinet plan, elevation, section and 3D boxes. -
Two computed values addons/cabinetcraft/lib/estimate.js:140 in sheetsFor CadCraft, BimCraft, ModelCraft, PartCraft
const m = nestJob && nestJob.mats.find((x) => x.material === g.material && x.thickness === g.thickness);=== in
x.thickness === g.thickness. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cabinet job cost estimate. -
Two computed values addons/lighting/lib/reports.js:84 in checks CadCraft
for (let i = 0; i < spans.length; i++) for (let j = i + 1; j < spans.length && spans[j].u === spans[i].u && spans[j].from <= spans[i].to; j++) {=== in
spans[j].u === spans[i].u. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values addons/windows/lib/cutlist/cutlist.js:86 in sameKind CadCraft
const sameKind = (a, b) => a.material === b.material && a.thickness === b.thickness && a.length === b.length && a.width === b.width &&=== in
a.thickness === b.thickness. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values addons/windows/lib/cutlist/cutlist.js:86 in sameKind CadCraft
const sameKind = (a, b) => a.material === b.material && a.thickness === b.thickness && a.length === b.length && a.width === b.width &&=== in
a.width === b.width. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values cadcraft.js:506 in rememberView CadCraft
if (top && top.cx === v.cx && top.cy === v.cy && top.zoom === v.zoom) return;=== in
top.cx === v.cx. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cursor point and status readouts. -
Two computed values cadcraft.js:506 in rememberView CadCraft
if (top && top.cx === v.cx && top.cy === v.cy && top.zoom === v.zoom) return;=== in
top.cy === v.cy. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cursor point and status readouts. -
Two computed values cadcraft.js:967 in withNextGhost CadCraft
if (!was || was.x !== n.x || was.y !== n.y) accessUi?.say(t('access.ghost.next', { what: t('auto.kind.' + n.kind), at: fmtL(n.x) + ', ' + fmtL(n.y) })); // EG.52: a ghost is said once when it appear!== in
was.x !== n.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cursor point and status readouts. -
Two computed values cadcraft.js:967 in withNextGhost CadCraft
if (!was || was.x !== n.x || was.y !== n.y) accessUi?.say(t('access.ghost.next', { what: t('auto.kind.' + n.kind), at: fmtL(n.x) + ', ' + fmtL(n.y) })); // EG.52: a ghost is said once when it appear!== in
was.y !== n.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cursor point and status readouts. -
Two computed values dwg/objects-write.js:659 in insertScale CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft
else if (sx === sy && sx === sz) { w.BB(2); w.RD(sx); }=== in
sx === sy. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: DWG object values written and read. -
Two computed values dwg/objects-write.js:659 in insertScale CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft
else if (sx === sy && sx === sz) { w.BB(2); w.RD(sx); }=== in
sx === sz. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: DWG object values written and read. -
Two computed values dwg/table-write.js:71 in insertScale CadCraft, ModelCraft, CivilCraft, DetailCraft, PartCraft
else if (sx === sy && sx === sz) { w.BB(2); w.RD(sx); }=== in
sx === sy. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register. -
Two computed values dwg/table-write.js:71 in insertScale CadCraft, ModelCraft, CivilCraft, DetailCraft, PartCraft
else if (sx === sy && sx === sz) { w.BB(2); w.RD(sx); }=== in
sx === sz. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register.