本文介紹了在 C++ 中評估數(shù)學(xué)表達(dá)式的最佳方法是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
例如,評估任何自定義數(shù)學(xué)表達(dá)式的最佳方法是什么
What is the best way to evaluate any custom math expression, for example
3+sqrt(5)+pow(3)+log(5)
我知道將 Python 嵌入 C++ 可以做到這一點;有沒有更好的辦法?
I know that embedding Python into C++ can do that; is there any better way?
謝謝!
推薦答案
Boost.Spirit 是一個 C++ 解析器庫.
Boost.Spirit is a C++ parser library.
示例:
- 在其發(fā)行版中:經(jīng)典版本和當(dāng)前 版本(查找calc");莉>
- 在羅塞塔維基;
- 一些使用它的應(yīng)用程序.
- in its distribution: classic version and current version (look for "calc");
- on Rosetta wiki;
- some applications using it.
這篇關(guān)于在 C++ 中評估數(shù)學(xué)表達(dá)式的最佳方法是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!