Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9252027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:50:41+00:00 2026-06-18T10:50:41+00:00

I need to parse a hexadecimal value to base 10 long integer. Value is

  • 0

I need to parse a hexadecimal value to base 10 long integer. Value is something like:

 9F2EEA4AA03D55B33172E9A86CFF6156AC1628C67983193A337B98995151F9B0F41562290DB98697280E805803E4B18914519CEB55CEA5D03A927C28C36A4BC7

How can i do this?

UPDATE:

In python, i used following:

>> num = "9F2EEA4AA03D55B33172E9A86CFF6156AC1628C67983193A337B98995151F9B0F41562290DB98697280E805803E4B18914519CEB55CEA5D03A927C28C36A4BC7"
>> int(num, 16)
>> 8337103942674051648235321365669510487642415361796636721089378763661406518267124809778145800381557738780272231500412167743930433352841689114003303823985607L

when my colleague tries @Sergey’s answer, my colleague get a different result (a negative value while mine is not a negative one)

>> BigInteger bigInteger = BigInteger.Parse(num, NumberStyles.HexNumber);
>> -5070703987268545451338703632536335639836950458795756656634182680060357511806422167023728497785345688909759626686073883109823449459104880832430345182098489
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:50:42+00:00Added an answer on June 18, 2026 at 10:50 am

    Please take a look at BigInteger Structure to work with large integers.

    BigInteger bigInteger = BigInteger.Parse("0D574F480A03D55B33172E9A86CFF6156AC1628C67983193A337B98995151F9B0F41562290DB98697280E805803E4B18914519CEB55CEA5D03A927C28C36A4BC7", NumberStyles.HexNumber);
    string s = bigInteger.ToString(); // String with decimal representation.
    

    Update

    Prepend (start) the string with 0 if the number should be interpreted as positive even if its first character is 8–F. See the example above: 0D574...

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to parse a C++ stdin input which looks something like this: N
I need to parse expression like 'a' 'b' 'cd ef' three tokens how can
I need to parse a configuration file which looks like this (simplified): <config> <links>
I need to parse a textfile with about 10000 groupings like this group C_BatTemp
I need parse a select value in html file. I have this html file:
Need to parse a file for lines of data that start with this pattern
I need parse a string inside a parenthesis, which looks like (A, B, C),
i need to parse html like : <div class=item><div class=title>title 1</div><div class=date>day 1</div></div> <div
I need to parse potentially huge XML files, so I guess this rules out
I need to parse a decimal integer that appears at the start of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.