Programming and large integers
By aslakjohansen
We are following DIKU’s course on Cryptography. In exercises we need to deal with large integers (> 264).
Since 264 = 18446744073709551616, I decided to implement some calculations on some larger value (i = 10000000000000000000001): subtraction, division, modulo. Below are implementations in a few languages. Each implementation lists instructions for compiling and running.
- Java using the BigInteger class [code]
- C using the GMP library [code]
- Python using buildin long type [code]
- C# No support in standard .NET namespace. Both Mono and J# are supposed to provide suitable classes.
This entry was posted on March 2, 2008 at 6:56 pm and is filed under cryptography. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.