After all this, the algorithm has grown a bit, and is a little trickier to get right in all the corner cases—but it’s still pretty simple, andcertainlyless work than a full-blown syntax-directed parser! In my opinion, it’s a shame that the shunting-yard algorithm isn’t more widel...
此函数可用于计算写为字符串(字符数组)的方程。 该函数的基础是Shunting yard算法,如在C#中示例: https : //rosettacode.org/wiki/Parsing/Shunting-yard_algorithm 调车码算法是一种解析数学表达式的方法在后缀表示法中以后缀表示法指定。 例子结果= EvalEquation('1