If approximation is OK, you can use floating-point (float
or double
) numbers. And you need pow
, not ^
, as the commenters said.
However, for cryptography, approximation doesn't work. You need support for arithmetic with very large integers. GMP provides general multiple-precision arithmetic support. Many cryptographic packages will also have such algorithms in their code, either through a third-party library or built-in; PuTTY has a bignum library for large integers, and OpenSSL probably has something similar.
Basic C data types are not enough.