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

Function term

test/compute-engine/latex-syntax/serialize.test.ts:123–127  ·  view source on GitHub ↗
(sym: string, val: number)

Source from the content-addressed store, hash-verified

121 expect(expr.toLatex()).toMatchInlineSnapshot(`3\\times2^2+5\\times2+3`);
122
123 const term = (sym: string, val: number) =>
124 ce
125 .expr(['Multiply', 3, ['Power', sym, 2]], { canonical: false })
126 .subs({ [sym]: val }, { canonical: false })
127 .toLatex();
128 // A numeric base that prettifies to a square still needs an explicit sign
129 expect(term('x', 2)).toMatchInlineSnapshot(`3\\times2^2`);
130 expect(term('x', 10)).toMatchInlineSnapshot(`3\\times10^2`);

Callers 1

serialize.test.tsFile · 0.70

Calls 3

toLatexMethod · 0.80
subsMethod · 0.65
exprMethod · 0.65

Tested by

no test coverage detected