Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Dealing with a large integer
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Me, post: 2453262"] I have an large integer in this format It looks like you're trying to convert a base-256 number to a base-900 number (i.e. all the the xN's are in the range [0, 255]). If this is the case, then you can do this: unsigned long long x = x1; x = x<<8 | x2; x = x<<8 | x3; x = x<<8 | x4; x = x<<8 | x5; And then to get y1..y5: y5 = x % 900; x /= 900; y4 = x % 900; x /= 900; y3 = x % 900; x /= 900; y2 = x % 900; x /= 900; y1 = x; [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Dealing with a large integer
Top