Skip to content

\prod, \sum with unknown in product/sum term returns NaN #252

@AdamArwejo

Description

@AdamArwejo

Steps to Reproduce

import { ComputeEngine } from "@cortex-js/compute-engine"; const ce = new ComputeEngine() const s = "\\sum_{n=1}^{10}(x)" const parsed = ce.parse(s) parsed.evaluate().print() 

The error also occurs if \\sum is replaced with \\prod, and regardless of the value of the bounds.

Actual Result

NaN is printed.

Expected Result

10x (in this case) is printed.

Environment

Using @cortex-js/compute-engine version 10.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions