The standard Math.pas function includes no standard functions. All that is implemented in the default evaluation analyzer is the operators or , xor , and , not , mod , + , - , / , * , < > , <= , >= , = , div , cmp , bor , bxor , band , bnot , shl and shr , (How much I found in quick source checking, and a few I skipped based on @David's comment.)
You can easily add features (including those that are part of Delphi RTL) for the evaluator. This is even shown in a demo that adds functions from one of the JCL blocks.
The JCL evaluator example (ExprEvalExample.dpr), found by default in the JCL\examples\common\expreval folder JCL\examples\common\expreval , passes < ExprEvalExampleLogic.pas to the Init function in ExprEvalExampleLogic.pas as the FuncList parameter, which is filled with this code ( TEasyEvaluator functions in the same same routine) with functions from 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;
These will be the features supported in the demo application. You can add your own in a similar way.
source share