You are here:

C++/enlarge the integer space


hi can i enlrage the specified area for integer in memory ?
or how can i compute a vey big integer like this for example :87987987987654654654654654654654654654256311323198987
is there any way unlimited space for integer in memory mor than 4 byte or even 8 or 16 byte

If you want to retain all digits, you need a class to handle larger numbers.  Usually BCD is used in this case.  The problem is it's slow to do math, but it can hold very large numbers exactly.  If you switch to a floating point number, you can represent that number but only to 11 or 12 digits.  Do a Google search for BCD class.  


All Answers

Answers by Expert:

Ask Experts


Bill A


I can answer questions about C++, programming algorithms, Windows programming in MFC (which is C++). I cannot answer questions about STL (templates) and I have no experience with Linux. I do enjoy reviewing code and critiquing it or finding problems in it. I will also gladly show better algorithms or methods if you want to take advantage of that.


I've developed a commercial embedded C compiler/assembler and IDE with debugger toolset, of which the IDE and debugger are written in C++. I work in the industry writing high tech embedded programs and Windows programs to communicate with the embedded devices.

Book: Embedded Systems Design using the Rabbit 3000 Microprocessor Authored Chapter 10 in its entirety.

BS Computer Engineering

©2016 All rights reserved.