没有任何标准功能Math.pas
包括。默认评估解析器中实现的所有内容都是运算符or
, xor
, and
, not
, mod
, +
, -
, /
, *
, <
, >
, <=
, >=
, =
, div
, cmp
, bor
, bxor
, band
, bnot
, shl
, and shr
。 (我在快速检查源代码时发现了很多,还有一些是根据@David 的评论我错过的。)
您可以相当轻松地将函数(包括 Delphi RTL 的一部分)添加到求值器中。它甚至在演示中进行了展示,添加了 JCL 单元之一的功能。
默认情况下在JCL\examples\common\expreval
文件夹传递一个TComboBox.Items
to the Init
函数于ExprEvalExampleLogic.pas
as the FuncList
参数,由此代码填充(TEasyEvaluator
给出了同一例程中的函数)以及来自的函数JclMath.pas
:
with FuncList do
begin
Add('LogBase10');
Add('LogBase2');
Add('LogBaseN');
Add('ArcCos');
Add('ArcCot');
Add('ArcCsc');
Add('ArcSec');
Add('ArcSin');
Add('ArcTan');
Add('ArcTan2');
Add('Cos');
Add('Cot');
Add('Coversine');
Add('Csc');
Add('Exsecans');
Add('Haversine');
Add('Sec');
Add('Sin');
Add('Tan');
Add('Versine');
Add('ArcCosH');
Add('ArcCotH');
Add('ArcCscH');
Add('ArcSecH');
Add('ArcSinH');
Add('ArcTanH');
Add('CosH');
Add('CotH');
Add('CscH');
Add('SecH');
Add('SinH');
Add('TanH');
end;
这些将是演示应用程序支持的功能。您可以以类似的方式添加您自己的。