423,504 Members | 1,125 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 423,504 IT Pros & Developers. It's quick & easy.

How to store numbers greater than 64bit in c++

P: 1
Please help,I'm kinda new to c++ programming
Aug 5 '18 #1
Share this Question
Share on Google+
2 Replies


weaknessforcats
Expert Mod 5K+
P: 9,181
This is too difficult for a beginner.

The conceptual answer is that you design for a large data item. Like maybe a string where each character is a digit of your number. Or perhaps a struct (class) whose data members are the number. Or maybe just a memory allocation where each bit is part of your number.

Then you write code to add/subtract/divide/multiply the data in your design. Then you overload the + - / * operators.


Lastly, all this work has already been done so you would just purchase large number code products and use those.
Aug 5 '18 #2

P: 2
Maybe you need some libraries like GSL, Boost or Eigen to represent huge numbers and their calculations. These libraries are widely used for many years and they are safe and efficient, so nothing to worry about the huge numbers technology, and you can pay more attentions on business request.
Aug 21 '18 #3

Post your reply

Sign in to post your reply or Sign up for a free account.