数学表达式解析器在Delphi中? [英] mathematical expression parser in Delphi?
本文介绍了数学表达式解析器在Delphi中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有内置的Delphi函数会将诸如'2 * x + power(x,2)'或任何等式的字符串转换为float?
Is there a built-in Delphi function which would convert a string such as '2*x+power(x,2)' or any equation to float? StrToFloat raises an exception because of the char X and power.
谢谢。
推荐答案
免费的 JCL 包括TEvaluator,由当前的Delphi编译工程师之一编写的解析器。它可能比基于Windows Script Host的表达式求值程序要高得多。
The free JCL includes TEvaluator, a parser written by one of the current Delphi compiler engineers. It will likely be far more efficient than an expression evaluator based on Windows Script Host.
这篇关于数学表达式解析器在Delphi中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文