Converting BitwiseXOR ^ to Power

Topics: Help
Jun 20, 2013 at 10:27 AM
Many thanks for this wonderful NCalc in which I am currently doing some RND. I'm new to c# so I need your help.

I have tried to modify the source code to use Math.Power when ^ is used in the expression. It is working if you have the proper grouping. ex.
2 * (10 ^ 5)

But below expression will evaluate first the Multiplication because ^ is not a mathematical operator and not the highest priority as per as parser is concerned.

2 * 10 ^ 5

Somehow the parser is grouping it to this format (2 * 10) ^ 5.
Any idea how to fix this scenario? I don't know yet whats the purpose of the Grammar file but maybe a little modification will do the job.

Thanks for your help,
JB