EvaluationException: extraneous input

Topics: General, Help
Oct 1, 2012 at 8:08 PM


I have a list of expressions that I parse out of a document and attempt to evaluate. Most work fine but some produce errors.

360/(Pow(2,16) – 1)

EvaluationException: extraneous input '1' expecting ')' at line 1:17

The really weird thing is that many of these expressions are repeated in my document and sometimes Expression.Evaluate works fine on them, sometimes not. I suspected a strange whitespace issue but removing whitespace from the string before creating the Expression didn't help.

Any ideas on why this happens or what I can do to work around it?

Oct 1, 2012 at 10:40 PM

Nevermind. That " - " in the problem cases was a unicode dash. Converted it prior to evaluating and NCalc works great.