用于计算字符串的数学库 [英] A math Library to calculate strings

查看:58
本文介绍了用于计算字符串的数学库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个字符串,如x = 1,y = 2,然后我想计算字符串x + y或x * y的结果,是否有任何图书馆可以实现我想要的东西???

非常感谢!

Hi guys,
I have a string such as "x = 1, y = 2", and then I want to calculate the result of string "x + y" or "x * y", does any library can implement what I want???
Thanks very much!

推荐答案

不。你可能会找到一个API但我自己写一个。



看下面的如何使用堆叠运算符解析算术字符串的例子



您可以提供一个API:

Math Parser .NET C# [ ^ ]
Nope. You may find an API but I'd write one myself.

Look at the below example of how to parse arithmetic strings using stacked operators

There may be a API you can pull out of it:
Math Parser .NET C#[^]


这与数学无关。因此,您不需要数学库,而是表达式解析器: https://www.google.ch/search?q=experession+parser&ie=utf-8&oe=utf-8& ; gws_rd = cr& ei = D4J5VZmaHoKQsAGDh6eYBw #q =表达式+解析器+ C%2B%2B [ ^ ] br />


该搜索的第一个打击看起来很有希望。 https://fastmathparser.codeplex.com/ [ ^ ]



PS:

本网站也有合适的点击:

快速数学表达式解析器 [ ^ ]

< a href =http://www.codeproject.com/Tips/747223/CalcStar-A-Cplusplus-Math-Expression-Evaluator> CalcStar:一个C ++数学表达式评估器 [ ^ ]
This has nothing to do with math. Consequently you don't need a math library, but an expression parser: https://www.google.ch/search?q=experession+parser&ie=utf-8&oe=utf-8&gws_rd=cr&ei=D4J5VZmaHoKQsAGDh6eYBw#q=expression+parser+C%2B%2B[^]

The first hit on that search already looks promising. https://fastmathparser.codeplex.com/[^]

P.S.:
There are also suitable hits on this site:
Fast Mathematical Expressions Parser[^]
CalcStar: A C++ Math Expression Evaluator[^]


这篇关于用于计算字符串的数学库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆