Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operators and whitespace #17

Open
napen123 opened this issue Jun 20, 2018 · 0 comments
Open

Operators and whitespace #17

napen123 opened this issue Jun 20, 2018 · 0 comments
Labels

Comments

@napen123
Copy link
Member

This fails to parse, with System.FormatException: Input string was not in a correct format being thrown:

MathParser parser = new MathParser();

parser.Operators.Add("λ", (left, right) => Math.Pow(left, right));

Assert.AreEqual(Math.Pow(3, 2), parser.Parse("3λ2"));

However, if the last statement is changed to have whitespace in the expression, it parses correctly:

Assert.AreEqual(Math.Pow(3, 2), parser.Parse("3 λ 2"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant