Thanks
yes i found the Function parser model and i am working on to extend more functions. It is Domain folder.
Infact i have already extended the Min function to parse a list of values rather than two vales
#region Min
case
"min":
CheckCase("Min", function.Identifier.Name);
if (function.Expressions.Length < 2)
throw new ArgumentException("Min() takes atleast 2 arguments, Separated by a comma");
double min = 0;
double f = 0;
for (int i = 0; i < function.Expressions.Length; i++)
{
try
{
f = Convert.ToDouble(Evaluate(function.Expressions[i]));
if (i == 0) min = f;
else
min = (min < f) ? min : f;
}
catch
{
throw new ArgumentException("Min() function has Invalid parameters. All parameters must be numeric separated by Comma");
}
}
Result = min;
break;
#endregion
The following Code extends the Secant function
case "sec":
CheckCase("sec", function.Identifier.Name);
if (function.Expressions.Length != 1)
throw new ArgumentException("Sec() Secant takes exactly 1 argument");
Result = (1 / Math.Cos(input));
break;
Please post any advice/ suggestions, if any improvements
thank you
arvind ps
