如何使用的BigInteger在VS 2010中 [英] How to use BigInteger in VS 2010

查看:188
本文介绍了如何使用的BigInteger在VS 2010中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用的BigInteger类型,即所谓的新的.NET Framework 4.0。

我似乎不能够尝试通过使用System.Numerics引用它时,得到它,并得到一个错误。

知不知道我做错了吗?很抱歉,如果这是一个愚蠢的问题...

解决方案
  1. 添加引用 System.Numerics 的组装到项目中。

    一个。在Solution Explorer中,用鼠标右键单击该项目节点,并点击添加引用

    乙。在添加引用对话框,请选择 .NET 标签。

    ℃。选择 System.Numerics ,然后点击确定

  2. 添加使用指令一个 进口的 System.Numerics 命名空间:

     使用System.Numerics;
     

  3. 使用的BigInteger结构

     变种I =新的BigInteger(934157136952);
     

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.

  2. Add a using directive importing the System.Numerics namespace:

    using System.Numerics;
    

  3. Use the BigInteger structure:

    var i = new BigInteger(934157136952);
    

这篇关于如何使用的BigInteger在VS 2010中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆