C# 我需要C中的大数值变量#

C# 我需要C中的大数值变量#,c#,variables,integer,C#,Variables,Integer,我需要在c中的一个变量中保存1024的2的幂# 我该怎么办? 我试过这个: label1.Text = "0"; decimal res = 0; res += System.Convert.ToDecimal(Math.Pow(2, 1024)); label1.Text = System.Convert.ToString(res); 你可以尝试使用 此外,如果您使用的环境中.NetBigInteger类不可用(例如针对.Net版本2的项目),则可以使用以下任何外部实现: 可

我需要在c中的一个变量中保存1024的2的幂# 我该怎么办? 我试过这个:

label1.Text = "0";
decimal res = 0;
res += System.Convert.ToDecimal(Math.Pow(2, 1024));
label1.Text = System.Convert.ToString(res);
你可以尝试使用

此外,如果您使用的环境中.Net
BigInteger
类不可用(例如针对.Net版本2的项目),则可以使用以下任何外部实现:


可能重复使用BigInteger-这是一个巨大的数字。它将有300多个数字。我希望你的标签真的很长。
var exponentiated = BigInteger.Pow(2, 1024);
var newText = exponentiated.ToString();