Evaluating mathematical expressions

前端 未结 5 976
囚心锁ツ
囚心锁ツ 2020-11-30 01:11

I am looking for an algorithm that I can use to evaluate mathematical expressions. I\'ve seen a few questions on SO that are simmilar but the answers are C#/Delphi or pytho

5条回答
  •  自闭症患者
    2020-11-30 01:18

    You can use Shunting-yard algorithm, it work's great and enables you to parse functions etc. at ease. It doesn't actually compute it, but it converts an expression to ONP, which can be evaluated very easily.

提交回复
热议问题