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 gds.js:133 in gdsEntities CadCraft
if (it.k === 'boundary') { if (pts.length > 1 && pts[0].x === pts[pts.length - 1].x && pts[0].y === pts[pts.length - 1].y) pts.pop(); if (pts.length >= 3) ents.push({ type: 'poly', layer: lname, color=== in
pts[0].x === pts[pts.length - 1].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: GDSII layout read and placement. -
Two computed values gds.js:133 in gdsEntities CadCraft
if (it.k === 'boundary') { if (pts.length > 1 && pts[0].x === pts[pts.length - 1].x && pts[0].y === pts[pts.length - 1].y) pts.pop(); if (pts.length >= 3) ents.push({ type: 'poly', layer: lname, color=== in
pts[0].y === pts[pts.length - 1].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: GDSII layout read and placement. -
Two computed values libitem.js:1715 in emit CadCraft, BimCraft
if (c4 && (c4.x !== c3.x || c4.y !== c3.y || (c4.z || 0) !== (c3.z || 0))) faces.push(q[0], q[2], q[3]);!== in
c4.x !== c3.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Library item geometry from blocks, meshes and tables, Lengths and units for Library items. -
Two computed values libitem.js:1715 in emit CadCraft, BimCraft
if (c4 && (c4.x !== c3.x || c4.y !== c3.y || (c4.z || 0) !== (c3.z || 0))) faces.push(q[0], q[2], q[3]);!== in
c4.y !== c3.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Library item geometry from blocks, meshes and tables, Lengths and units for Library items. -
Two computed values libitem.js:1715 in emit CadCraft, BimCraft
if (c4 && (c4.x !== c3.x || c4.y !== c3.y || (c4.z || 0) !== (c3.z || 0))) faces.push(q[0], q[2], q[3]);!== in
(c4.z || 0) !== (c3.z || 0). Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Library item geometry from blocks, meshes and tables, Lengths and units for Library items. -
Two computed values m3d/earcut.js:161 in findHoleBridge CadCraft, TakeoffCraft
if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {!== in
p.next.y !== p.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Triangulation of faces with holes. -
Two computed values m3d/earcut.js:179 in findHoleBridge CadCraft, TakeoffCraft
if (locallyInside(p, hole) && (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {=== 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: Triangulation of faces with holes. -
Two computed values m3d/earcut.js:194 in getLeftmost CadCraft, TakeoffCraft
if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;=== in
p.x === leftmost.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Triangulation of faces with holes. -
Two computed values m3d/earcut.js:217 in equals CadCraft, TakeoffCraft
const equals = (p1, p2) => p1.x === p2.x && p1.y === p2.y;=== in
p1.x === p2.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Triangulation of faces with holes. -
Two computed values m3d/earcut.js:217 in equals CadCraft, TakeoffCraft
const equals = (p1, p2) => p1.x === p2.x && p1.y === p2.y;=== in
p1.y === p2.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Triangulation of faces with holes. -
Two computed values m3d/earcut.js:247 in middleInside CadCraft, TakeoffCraft
if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) inside = !inside;!== in
p.next.y !== p.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Triangulation of faces with holes. -
Two computed values m3d/model.js:137 in meshGeometry CadCraft
if (g && g.v === mesh.v && !mesh.recording) return g.def;=== in
g.v === mesh.v. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Face planes, areas, triangles and solid volume, Drawing an edge: welding, splitting and re-facing, Push/pull, move, stretch, follow me and intersect, Arcs, circles, smooth curves, divide and offset, Dimensions and typed sizes in 3D, Groups, placements and the model file, Welding of imported geometry, Smooth shading and texture placement. -
Two computed values m3d/model.js:538 in addEdge CadCraft
if (stops[i].v === stops[i + 1].v) continue;=== in
stops[i].v === stops[i + 1].v. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Face planes, areas, triangles and solid volume, Drawing an edge: welding, splitting and re-facing, Push/pull, move, stretch, follow me and intersect, Arcs, circles, smooth curves, divide and offset, Dimensions and typed sizes in 3D, Groups, placements and the model file, Welding of imported geometry, Smooth shading and texture placement. -
Two computed values m3d/tools.js:1060 in down CadCraft
const inSel = this.h.sel.some((x) => x.t === s.t && x.id === s.id);=== in
x.t === s.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: 3D drawing and editing tools. -
Two computed values m3d/unit-table.js:126 in convert CadCraft
if (a === b || a.factor === b.factor) return v;=== in
a.factor === b.factor. 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 macro.js:46 in call CadCraft
if (name === '=') return Number(args[0]) === Number(args[1]) ? '1' : '0';=== in
Number(args[0]) === Number(args[1]). 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 pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[0].x === c[1].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[1].y === c[2].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[2].x === c[3].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[3].y === c[0].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[0].y === c[1].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[1].x === c[2].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[2].y === c[3].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values pdfmodel.js:136 in isAxisRect CadCraft
const isAxisRect = (c) => c.length === 4 && ((c[0].x === c[1].x && c[1].y === c[2].y && c[2].x === c[3].x && c[3].y === c[0].y) || (c[0].y === c[1].y && c[1].x === c[2].x && c[2].y === c[3].y && c[3].=== in
c[3].x === c[0].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: PDF underlay placement and PDF import. -
Two computed values redline.js:80 in frameOf CadCraft
if (!validBounds(b) || b.maxX === b.minX || b.maxY === b.minY) return null;=== in
b.maxX === b.minX. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Redline items placed in the drawing. -
Two computed values redline.js:80 in frameOf CadCraft
if (!validBounds(b) || b.maxX === b.minX || b.maxY === b.minY) return null;=== in
b.maxY === b.minY. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Redline items placed in the drawing. -
Two computed values sketch.js:143 in cleanStroke CadCraft
const sq = ang !== Math.atan2(last.y - first.y, last.x - first.x);!== in
ang !== Math.atan2(last.y - first.y, last.x - first.x). Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Pen sketch cleanup. -
Two computed values unit-table.js:126 in convert CadCraft, BimCraft, ModelCraft, MarkupCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (a === b || a.factor === b.factor) return v;=== in
a.factor === b.factor. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Unit conversion, Unit table: reading and writing values. -
Two computed values usd/earcut.js:162 in findHoleBridge CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {!== in
p.next.y !== p.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/earcut.js:180 in findHoleBridge CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (locallyInside(p, hole) && (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {=== 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 (ear clipping). -
Two computed values usd/earcut.js:195 in getLeftmost CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;=== in
p.x === leftmost.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/earcut.js:218 in equals CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
const equals = (p1, p2) => p1.x === p2.x && p1.y === p2.y;=== in
p1.x === p2.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/earcut.js:218 in equals CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
const equals = (p1, p2) => p1.x === p2.x && p1.y === p2.y;=== in
p1.y === p2.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/earcut.js:248 in middleInside CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) inside = !inside;!== in
p.next.y !== p.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Polygon triangulation (ear clipping). -
Two computed values usd/geom.js:92 in valueAt CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
if (!a || !b || a.t !== b.t || typeof a.v === 'string' || a.t.startsWith('quat') || a.t.includes('token') || a.t === 'bool') return a;!== in
a.t !== b.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: USD transforms and placement, USD mesh coordinates in saved and exported files. -
Two computed values view.js:363 in syncEntered CadCraft
if (b.cx !== vp.cx || b.cy !== vp.cy || b.s !== vp.s || b.tw !== (vp.tw || 0)) {!== in
b.cx !== vp.cx. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Picked points, object snaps and viewport views, 2D drawing on screen. -
Two computed values view.js:363 in syncEntered CadCraft
if (b.cx !== vp.cx || b.cy !== vp.cy || b.s !== vp.s || b.tw !== (vp.tw || 0)) {!== in
b.cy !== vp.cy. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Picked points, object snaps and viewport views, 2D drawing on screen. -
Two computed values geotech.js:230 in interp CivilCraft
return b.x === a.x ? b.z : a.z + ((x - a.x) / (b.x - a.x)) * (b.z - a.z);=== in
b.x === a.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Boring logs and the soil profile between borings, Slope stability, Foundation settlement. -
Two computed values ground-surface.js:69 in closedPts CivilCraft
const closedPts = (l) => (l.closed && l.pts.length > 2 && (l.pts[0].x !== l.pts[l.pts.length - 1].x || l.pts[0].y !== l.pts[l.pts.length - 1].y) ? [...l.pts, l.pts[0]] : l.pts);!== in
l.pts[0].x !== l.pts[l.pts.length - 1].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Ground surface from contour lines and points. -
Two computed values ground-surface.js:69 in closedPts CivilCraft
const closedPts = (l) => (l.closed && l.pts.length > 2 && (l.pts[0].x !== l.pts[l.pts.length - 1].x || l.pts[0].y !== l.pts[l.pts.length - 1].y) ? [...l.pts, l.pts[0]] : l.pts);!== in
l.pts[0].y !== l.pts[l.pts.length - 1].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Ground surface from contour lines and points. -
Two computed values platform.js:123 in cleanSectionLines CivilCraft
if (line.length < 2 || line.every((p) => p.x === line[0].x && p.y === line[0].y)) return null;=== in
p.x === line[0].x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cut and fill map, spot levels, sloped pads and free sections. -
Two computed values platform.js:123 in cleanSectionLines CivilCraft
if (line.length < 2 || line.every((p) => p.x === line[0].x && p.y === line[0].y)) return null;=== in
p.y === line[0].y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Cut and fill map, spot levels, sloped pads and free sections. -
Two computed values point-edit.js:59 in checkPointEdit CivilCraft
if (next.n === old.n && next.x === old.x && next.y === old.y && next.z === old.z && (next.d || '') === (old.d || '')) return { ok: false, errors: {}, message: '' };=== in
next.x === old.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 point-edit.js:59 in checkPointEdit CivilCraft
if (next.n === old.n && next.x === old.x && next.y === old.y && next.z === old.z && (next.d || '') === (old.d || '')) return { ok: false, errors: {}, message: '' };=== in
next.y === old.y. 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 point-edit.js:59 in checkPointEdit CivilCraft
if (next.n === old.n && next.x === old.x && next.y === old.y && next.z === old.z && (next.d || '') === (old.d || '')) return { ok: false, errors: {}, message: '' };=== in
next.z === old.z. 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 point-edit.js:68 in editPoint CivilCraft
const moved = point.x !== old.x || point.y !== old.y || point.z !== old.z;!== in
point.x !== old.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 point-edit.js:68 in editPoint CivilCraft
const moved = point.x !== old.x || point.y !== old.y || point.z !== old.z;!== in
point.y !== old.y. 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 point-edit.js:68 in editPoint CivilCraft
const moved = point.x !== old.x || point.y !== old.y || point.z !== old.z;!== in
point.z !== old.z. 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 point-edit.js:74 in editPoint CivilCraft
if (v.x !== old.x || v.y !== old.y) continue;!== in
v.x !== old.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 point-edit.js:74 in editPoint CivilCraft
if (v.x !== old.x || v.y !== old.y) continue;!== in
v.y !== old.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Not in the register.