Big numbers in C

Posted by teehoo on Stack Overflow See other posts from Stack Overflow or by teehoo
Published on 2010-04-14T20:03:51Z Indexed on 2010/04/14 20:13 UTC
Read the original article Hit count: 407

Filed under:
|
|

I need help working with very big numbers. According to Windows calc, the exponent 174^55 = 1.6990597648061509725749329578093e+123. How would I store this using C (c99 standard).

int main(){
 long long int x = 174^55; //result is 153
 printf("%lld\n", x);
}

For those curious, it is for a school project where we are implementing the RSA cryptographic algorithm, which deals with exponentiating large numbers with large powers for encryption/decryption.

© Stack Overflow or respective owner

Related posts about c

    Related posts about big