(ce: ComputeEngine, e: Expression)
| 244 | } |
| 245 | |
| 246 | function negate(ce: ComputeEngine, e: Expression): Expression { |
| 247 | if (isNumber(e)) return e.neg().evaluate(); |
| 248 | if (e.operator === 'Multiply' && e.ops && isNumber(e.ops[0])) |
| 249 | return ce._fn('Multiply', [e.ops[0].neg().evaluate(), ...e.ops.slice(1)]); |
| 250 | return ce._fn('Multiply', [ce.NegativeOne, e]); |
| 251 | } |