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

Function serializeSolve

test/compute-engine/explain.test.ts:460–470  ·  view source on GitHub ↗
(
  latex: string,
  options?: { variable?: string }
)

Source from the content-addressed store, hash-verified

458): { initial: string; result: string; steps: string[] } {
459 const ex = ce.parse(latex).explain('solve', options);
460 return {
461 initial: ex.initial.toString(),
462 result: ex.result.toString(),
463 steps: ex.steps.map((s) => `${s.id}: ${s.value.toString()}`),
464 };
465}
466
467describe('explain: golden solve explanations', () => {
468 test('2x+1=5: linear isolation', () => {
469 expect(serializeSolve('2x+1=5')).toMatchSnapshot();
470 });
471
472 test('x^2=4: quadratic (two roots)', () => {
473 expect(serializeSolve('x^2=4')).toMatchSnapshot();

Callers 1

explain.test.tsFile · 0.85

Calls 4

explainMethod · 0.65
parseMethod · 0.65
toStringMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected