Store and work with Big numbers in C

Normal types in C can usually only store up to 64 bits, so you’ll have to store big numbers in an array, for example, and write mathematical operations yourself. But you shouldn’t reinvent the wheel here – you could try the GNU Multiple Precision Arithmetic Library for this purpose.

And as the comments already pointed out, the ^ operation is binary XOR. For exponentiation, you will have to use mathematical functions like pow.

Leave a Comment