UNPKG

@holgerengels/compute-engine

Version:

Symbolic computing and numeric evaluations for JavaScript and Node.js

11 lines (10 loc) 528 B
/* 0.26.0-alpha2 */ import type { BoxedExpression, IComputeEngine } from '../public'; /** * Distribute `Negate` (multiply by -1) if expr is a number literal, an * addition or multiplication or another `Negate`. * * It is important to do all these to handle cases like * `-3x` -> ["Negate, ["Multiply", 3, "x"]] -> ["Multiply, -3, x] */ export declare function negate(expr: BoxedExpression): BoxedExpression; export declare function negateProduct(ce: IComputeEngine, args: ReadonlyArray<BoxedExpression>): BoxedExpression;