AngouriMath
FromString
Method with 2 overloads
FromString(System.String,System.Boolean)
Summary
Converts a String to an expressionParameter "expr"
String expression, for example,"2 * x + 3 + sqrt(x)"
Parameter "useCache"
By default is true, it boosts performance if you have multiple uses of the same string,
for example,
Entity expr = (Entity)"+oo" + "x".Limit("x", "+oo") * "+oo";
First occurance will be parsed, others will be replaced with the cached entity
Returns
The parsed expressionExample
Multiple ways to parse an expression.
Entity expr1 = "a + b"; var expr2 = FromString("a + b"); var expr3 = FromString("a + b", useCache: false); var expr4 = (Entity)"a + b"; var expr5 = Parse("a + b").Switch( res => res, failure => failure.Reason.Switch<object>( unknown => throw new("Unknown reason"), missingOp => throw new("Missing operator"), internalError => throw new("Internal error") ) );
FromString(System.String)
Summary
Converts a String to an expressionParameter "expr"
String expression, for example,"2 * x + 3 + sqrt(x)"
Returns
The parsed expressionExample
Multiple ways to parse an expression.
Entity expr1 = "a + b"; var expr2 = FromString("a + b"); var expr3 = FromString("a + b", useCache: false); var expr4 = (Entity)"a + b"; var expr5 = Parse("a + b").Switch( res => res, failure => failure.Reason.Switch<object>( unknown => throw new("Unknown reason"), missingOp => throw new("Missing operator"), internalError => throw new("Internal error") ) );
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online