0

I am doing my 3x program and developing 3x I found this article about handling big numbers but final result is string and with string I can't do math operations. I use gcc compiler.

Also this program is not meant to solve problem, I created just to test performance.

Andrej
  • 11
  • 1
  • 3

1 Answers1

0

In fact, you can't. C supports integers of limited length (64 bits, about 20 digits), and floats (about 15 significant digits), not larger.

So there is no better way than using a representation in a large radix (power of 2 or power of 10) and implementing the operations based on this representation. E.g. addition can be done digit by digit, with occasional carries.

  • Actually I did what I wanted using GNU GMP library. Code is on GitHub if you want take a look. Thanks to everyone which contributed. – Andrej Jul 17 '22 at 19:56