我正在尝试在我的应用程序中使用 nCalc,但遇到了问题,无论出于何种原因它想要转换为 UInt16 并导致错误。
string evalstring = "-.503937 ^ 2";
Expression e = new Expression(evalstring);
this.Value = Convert.ToDouble(e.Evaluate());
这抛出;
System.OverflowException occurred
HResult=-2146233066
Message=Value was either too large or too small for a UInt16.
Source=mscorlib
StackTrace:
at System.Convert.ToUInt16(Int32 value)
InnerException: