问题
I have been trying to use the BigInteger type, that is supposedly new in .NET Framework 4.0.
I don't seem to be able to get to it, and get an error when trying to reference it via Using System.Numerics.
Any idea what I'm doing wrong? Sorry if this is a stupid question...
回答1:
Add a reference to the System.Numerics assembly to your project.
a. In Solution Explorer, right-click the project node and click Add Reference.
b. In the Add Reference dialog box, select the .NET tab.
c. Select System.Numerics, and then click OK.
Add a using directive importing the System.Numerics namespace:
using System.Numerics;
Use the BigInteger structure:
var i = new BigInteger(934157136952);
回答2:
Did you add a reference to System.Numerics?
Right click on References -> Add Reference -> .NET tab -> System.Numerics -> OK
回答3:
Add a Reference to System.Numerics assembly.
Add using System.Numerics;
statement
回答4:
Have you added a project reference (Project... Add Reference...) to System.Numerics?
来源:https://stackoverflow.com/questions/4281858/how-to-use-biginteger-in-vs-2010