Mathf.Pow在C#上显示无穷大

问题描述

我正在尝试使用Mathf.Pow()计算一个大数,但是当我放置一个断点显示无穷大时,我已经尝试使用System.Numerics.BigInteger,但是它显示了 Big Integer无法显示无穷大

这是我的代码

    using System;
using System.Numerics;
namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            //43
            BigInteger res = new BigInteger(MathF.Pow(43,27));
            Console.WriteLine(res);
        }
    }
}

解决方法

如杰里米所说

您可以改用BigInteger.Pow

我使用了BigInteger res = BigInteger.Pow(43,27);,效果很好,谢谢!

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...