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

Function rationalExponent

src/compute-engine/boxed-expression/solve.ts:1450–1459  ·  view source on GitHub ↗

If `e` is a rational constant, return it as `[numerator, denominator]` * (denominator > 0); otherwise `null`.

(e: Expression)

Source from the content-addressed store, hash-verified

1448 variable: string
1449): Expression {
1450 if (!isFunction(expr, 'Add')) return expr;
1451
1452 const ce = expr.engine;
1453 const ops = expr.ops;
1454 if (ops.length === 0) return expr;
1455
1456 // Find the sqrt term(s) in the expression
1457 let sqrtTerm: Expression | null = null;
1458 let sqrtIndex = -1;
1459
1460 for (let i = 0; i < ops.length; i++) {
1461 const op = ops[i];
1462 // Check for Sqrt(...)

Callers 2

collectFunction · 0.85
rewriteFunction · 0.85

Calls 1

asSmallIntegerFunction · 0.90

Tested by

no test coverage detected