There was an error while loading. Please reload this page.
There are a few ways to parse an expression from string.
using AngouriMath; var expr = MathS.FromString("1 + 1");
It will throw an exception if input is bad.
using AngouriMath; Entity expr = "1 + 1";
It will also throw an exception in case of bad input.
Unlike others, this one won't throw. However, it returns an object which requries validation:
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") ) );