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.

Leave a Reply