Currently

Founder & CTO @SMERGERS &
@wealthrox
Previously

Dev Infra Intern @Google NYC
RF @NI-WCDMA Computer Science @USC

Contact

hey [at] krishnabharadwaj.info

26-Oct-2008

I follow discussions on the Algorithms community on orkut. Came across one question which asked us to implement very big integers in C/C++. We can calculate 12! using integer data type, 20! using long long. Java provides a data type BigInteger which can handle it, Python can handle REALLY LARGE VALUES. In C/C++ we can implement this with the help of an integer array where each digit is represented as an element of the array. I have used a class for this purpose.

Here's my implementation of a large number in C++..

Nandakumar
Sept. 30, 2012

Hey thanks for the code... :) One doubt..Why are you using a matrix of size 2*size+1 X 2*size in your operator * function??? HERE in this line of your code: int mat[2*SIZE+1][2*SIZE]={0};I thought mat[2*size][size] was enough.... Is it necessary to have it?

Avi Dullu
Oct. 29, 2011

Heard of Discrete Fourier Transform?

Krishna Bharadwaj
Oct. 29, 2011

Hi Avi,

I have heard of DFT, but never thought about it when I wrote this 3 years back.

Thanks