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

Function addForm

src/compute-engine/boxed-expression/canonical.ts:283–295  ·  view source on GitHub ↗
(expr: Expression)

Source from the content-addressed store, hash-verified

281 // spelling either — renaming to `Divide` here would turn the caller
282 // error into silent division once the result is fully canonicalized.
283 if (
284 name === 'Rational' &&
285 ops.some((op) => evidenceAdmissionOf(op, 'integer') === 'refute')
286 )
287 return ce._fn('Rational', ops, { canonical: false });
288
289 return ce._fn('Divide', ops, { canonical: false });
290 }
291
292 //
293 // Complex
294 //
295 if (name === 'Complex') {
296 if (ops.length === 1) {
297 // If single argument, assume it's imaginary, i.e.
298 // `["Complex", 2]` -> `2i`

Callers 1

canonicalFormFunction · 0.85

Calls 5

isFunctionFunction · 0.90
canonicalAddFunction · 0.90
mapMethod · 0.65
negMethod · 0.65
_fnMethod · 0.65

Tested by

no test coverage detected