1
我想在我的應用程序中使用nCalc,但遇到了問題,它想要轉換爲UInt16出於任何原因並導致錯誤。使用ToUInt16()停止nCalc?
string evalstring = "-.503937^2";
Expression e = new Expression(evalstring);
this.Value = Convert.ToDouble(e.Evaluate());
This throws;
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: