wdpr
    Preparing search index...
    • Evaluate a mathematical expression string and return the result.

      The expression is tokenized, parsed with a recursive descent parser, and evaluated in a single pass. Errors produce Wikidot-compatible messages (e.g., "division by zero", "too many values in the stack").

      NaN and Infinity results are treated as division-by-zero errors.

      Parameters

      • expr: string

        The expression string to evaluate.

      Returns ExprResult

      A success result with a numeric value, or an error result with a message.