Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
2.40/5 (3 votes)
See more:
Hi Team,

I am having,
VB
Dim HexString As String = "10ABC345DE7859410ABC39410ABC34545DE78DE7FA4545DE78DE7FABD12345"

I need HexString into BigInteger

integer or decimal or long or double are not enough size limit so i chosen BigInteger
provide solutions?
Thanks in Advance.
Posted
Updated 29-Apr-14 4:43am
v2
Comments
phil.o 29-Apr-14 10:43am    
And what have you tried already? Did you go and see the BigInteger class properties and methods on MSDN?

 
Share this answer
 
try with System.Numerics.BigInteger.Parse method
VB
Dim result = System.Numerics.BigInteger.Parse("10ABC345DE7859410ABC39410ABC34545DE78DE7FA4545DE78DE7FABD12345", System.Globalization.NumberStyles.AllowHexSpecifier)
 
Share this answer
 
v2
Comments
Mohankumar.Engain 30-Apr-14 5:16am    
Thank you DamithSL. Now! It is working.
Mohankumar.Engain 5-May-14 9:07am    
This below example:
Compare to different BigInteger's Code:

BigInteger number1 = BigInteger.Pow(Int64.MaxValue, 100);
BigInteger number2 = number1 + 1;
string relation = "";
switch (BigInteger.Compare(number1, number2))
{
case -1:
relation = "<";
break;
case 0:
relation = "=";
break;
case 1:
relation = ">";
break;
}
Console.WriteLine("{0} {1} {2}", number1, relation, number2);
Mohankumar.Engain 5-May-14 9:11am    
This is my expected results. check the below link also.
VB
Link:
http://msdn.microsoft.com/en-us/library/system.numerics.biginteger.compare.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2
 
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