Click here to Skip to main content
15,905,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 ?
Posted

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

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


--Amit
 
Share this answer
 
v2
Comments
ER Chinmay Pandya 14-Jun-13 3:29am    
i have tried this , but don't know my studio do not have biginteger , how can i add this ?
_Amy 14-Jun-13 3:34am    
You'll have to add a reference of System.Numerics.dll. Then only you'll able to use C# BigInteger.
ER Chinmay Pandya 14-Jun-13 3:44am    
yah , had figured it out my self

now please tell me how to find modulas ?

means (2790 to the power of 3333) mod 40 , i want this answer
As an alternative to the proposed CodeProject's article, you may also have a look at the very .NET Framework's BigInteger class[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900