This project has moved and is read-only. For the latest updates, please go here.

Issue at 'pi' and 'e' constants


I was working in C# using the Mathos Parser (v1.0.5.1), and I noticed that when I used the command


the value returned by the parser was 314159265358979 (pi * 100000000000000). The comma/dot just disappeared.

I've already found a solution by myself, I'll write it here so it can be fixed for everyone:
At line 407 of MathParser.cs, the command

_tokens[i] = LocalVariables[_tokens[i]].ToString();

has been returning a value with comma, and the program just work with dot. That's the issue. The solution is to change this command to this:

_tokens[i] = LocalVariables[_tokens[i]].ToString().Replace(',', '.');

I did this change and the problem is solved.
I hope it can help someone!
P.S.: Good work Artem Los, your code helped me a lot!


artemlos wrote Oct 25, 2014 at 1:24 PM

Thank you for your solution! :)
I am very happy Mathos Parser was to some help!


P.S. Sorry for such a late reply. I did not receive any notification that this issue was created. If you would like to contact me in future, please use the form at or my twitter: @artemlos.