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.
-
Against a decimal usd/util.js:60 in floatToHalf CadCraft, BimCraft, ModelCraft, TakeoffCraft, CivilCraft, DetailCraft, PartCraft
return sign | (rest > 0.5 || (rest === 0.5 && (r & 1)) ? r + 1 : r);=== in
rest === 0.5. Compare within a documented epsilon, or test with < or > if a range is meant. Reviewed: Half floats in USD. -
Against a decimal io/pbr.js:49 in gltfToOpenPBR ModelCraft
if (m.ior !== 1.5) p.specular_ior = m.ior;!== in
m.ior !== 1.5. Compare within a documented epsilon, or test with < or > if a range is meant. Reviewed: Imported material parameters. -
Against a decimal io/pbr.js:107 in openPBRToGltf ModelCraft
if (p.specular_ior !== undefined && p.specular_ior !== 1.5) ext('KHR_materials_ior', { ior: round(p.specular_ior) });!== in
p.specular_ior !== 1.5. Compare within a documented epsilon, or test with < or > if a range is meant. Reviewed: Imported material parameters. -
Against a decimal tools.js:1542 in computeGrips ModelCraft
if (f.every((x) => x === 0.5)) continue;=== in
x === 0.5. Compare within a documented epsilon, or test with < or > if a range is meant. Not in the register. -
Against a decimal tools.js:1543 in computeGrips ModelCraft
const mask = f.map((x, a) => x !== 0.5 && live[a]);!== in
x !== 0.5. Compare within a documented epsilon, or test with < or > if a range is meant. Not in the register. -
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 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 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 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. -
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 addons/flow/lib/sim.js:52 in less ModelCraft
less(x, y) { return x.t < y.t || (x.t === y.t && (x.p < y.p || (x.p === y.p && x.s < y.s))); }=== in
x.t === y.t. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Material flow simulation. -
Two computed values anim/curves-ui.js:255 in pickKeys ModelCraft
for (const s of sel) { if (!/^p\d+$/.test(String(s.track))) continue; const tr = a.props?.[+s.track.slice(1)]; const i = tr ? tr.keys.findIndex((k) => k.t === s.t) : -1; if (i >= 0) for (let c = 0; c=== in
k.t === s.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 anim/rig-view.js:190 in hitAt ModelCraft
if (!this.S || this.S.m !== m || (!this.stroke && (this.S.topo !== m.topo || this.S.v !== m.v))) { this.S = new Sculptor(m); this.S.v = m.v; }!== in
this.S.v !== m.v. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Bone frames and pose matrices. -
Two computed values earcut.js:161 in findHoleBridge ModelCraft
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. Not in the register. -
Two computed values earcut.js:179 in findHoleBridge ModelCraft
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. Not in the register. -
Two computed values earcut.js:194 in getLeftmost ModelCraft
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. Not in the register. -
Two computed values earcut.js:217 in equals ModelCraft
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. Not in the register. -
Two computed values earcut.js:217 in equals ModelCraft
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. Not in the register. -
Two computed values earcut.js:247 in middleInside ModelCraft
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. Not in the register. -
Two computed values io/3dm/earcut.js:162 in findHoleBridge ModelCraft
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. Not in the register. -
Two computed values io/3dm/earcut.js:180 in findHoleBridge ModelCraft
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. Not in the register. -
Two computed values io/3dm/earcut.js:195 in getLeftmost ModelCraft
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. Not in the register. -
Two computed values io/3dm/earcut.js:218 in equals ModelCraft
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. Not in the register. -
Two computed values io/3dm/earcut.js:218 in equals ModelCraft
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. Not in the register. -
Two computed values io/3dm/earcut.js:248 in middleInside ModelCraft
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. Not in the register. -
Two computed values mesh/ops.js:920 in slideRails ModelCraft
out.set(v, { a: dirs[0].w, b: dirs[dirs.length - 1].w === dirs[0].w ? -1 : dirs[dirs.length - 1].w });=== in
dirs[dirs.length - 1].w === dirs[0].w. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Proportional editing weights and edge creases, Inset, bevel and moves along normals, Subdivide, loop cut, bisect, knife and grid fill, Merge, spin, bridge, slide and smooth. -
Two computed values mesh/pick.js:23 in fresh ModelCraft
fresh() { return this.v === this.mesh.v && this.nh === this.mesh.nh; }=== in
this.v === this.mesh.v. 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 mesh/sculpt-tool.js:33 in sculptor ModelCraft
if (!this.S || this.S.m !== m || (!this.stroke && (this.S.topo !== m.topo || this.S.liveTopo !== m.liveTopo || this.S.v !== m.v))) { this.S = new Sculptor(m); this.S.v = m.v; }!== in
this.S.v !== m.v. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Sculpt brushes. -
Two computed values model.js:137 in meshGeometry ModelCraft
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. Not in the register. -
Two computed values model.js:538 in addEdge ModelCraft
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. Not in the register. -
Two computed values modelcraft.js:918 in init ModelCraft
if (c.x !== pinch.c.x || c.y !== pinch.c.y) cam[move](c.x - pinch.c.x, c.y - pinch.c.y, pinch.pivot);!== in
c.x !== pinch.c.x. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Entity info: volume, size, angle and area, Edits and settings from the main window. -
Two computed values modelcraft.js:918 in init ModelCraft
if (c.x !== pinch.c.x || c.y !== pinch.c.y) cam[move](c.x - pinch.c.x, c.y - pinch.c.y, pinch.pivot);!== in
c.y !== pinch.c.y. Compare within a documented epsilon scaled to the size of the geometry, or restructure so one side is exact. Reviewed: Entity info: volume, size, angle and area, Edits and settings from the main window. -
Two computed values modelcraft.js:1223 in openCtxMenu ModelCraft
if (s && !host.sel.some((x) => x.t === s.t && x.id === s.id)) host.setSel([s]);=== 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: Entity info: volume, size, angle and area, Edits and settings from the main window.