vb中的一个非常长的整数 [英] a very long integer in vb

查看:438
本文介绍了vb中的一个非常长的整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio 2010,在视觉基础窗口应用程序项目上工作



在我的项目中我必须使用非常大的数字计算,如2790到功率2753

i尝试了Math.pow函数,但它无法计算它



i也尝试用int32,int64循环执行十进制,长,Ulong数据类型,但非可以做到



但我的Windows计算器可以计算它,意味着我的PC能够计算它,但我的程序不是



那我怎么做功能呢?

解决方案

你应该用 BigInteger [ ^ ]这种情况。



在此场景使用: BigInteger.Pow方法 [ ^ ]





- Amit


作为建议的 CodeProject 的文章的替代方案,你也可以查看非常。 .NET Framework BigInteger类 [ ^ ]。

i am on a visual studio 2010 , working on a visual basics windows application project

in my project i have to compute with very large numbers like 2790 to the power 2753
i tried Math.pow function but it could not compute it

i also tried to do it in a loop with int32 , int64 , decimal , long , Ulong data types but non could do it

but my windows calculator can compute it , means my PC is able to compute it but my program is not

so how can i do the power function ?

解决方案

You should use BigInteger[^] for such a situation.

In this scenario use : BigInteger.Pow Method[^]


--Amit


As an alternative to the proposed CodeProject's article, you may also have a look at the very .NET Framework's BigInteger class[^].


这篇关于vb中的一个非常长的整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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