MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / classify

Function classify

test/compute-engine/nightly/exactness-grid.test.ts:65–80  ·  view source on GitHub ↗
(e: any)

Source from the content-addressed store, hash-verified

63];
64
65function classify(e: any): string {
66 try {
67 if (e === undefined || e === null) return 'undef';
68 if (e.isNaN) return 'NaN';
69 if (e.isInfinity) return 'inf';
70 if (e.isNumberLiteral) {
71 const nv = e.numericValue;
72 if (typeof nv === 'number') return Number.isInteger(nv) ? 'exact' : 'FLOAT';
73 return nv.isExact ? 'exact' : 'FLOAT';
74 }
75 if (e.operator === 'Error') return 'error';
76 return 'symbolic';
77 } catch (err) {
78 return 'ERR:' + err;
79 }
80}
81
82function num(e: any): [number, number] {
83 try {

Callers 1

checkCellFunction · 0.70

Calls 1

isIntegerMethod · 0.45

Tested by

no test coverage detected