/biginteger

A C# BigInteger implementation (e.g. for Unity)

Primary LanguageC#OtherNOASSERTION

biginteger

A C# BigInteger implementation based on the BigInteger class by Scott Garland.

This class can be used in Unity, since the System.Numerics is not available there.

This version introduces some fixes and additions to the original file. (WIP)

Current fixes:

  • BigInteger.Add(..) was originally subtracting the numbers
  • Fixed the LeftShift operator (<<) to work correctly with negative numbers and Two's complement.

Current additions:

  • BigInteger.Pow(b, exponent) (currently only for positive exponents)
  • b.Pow(exponent) (currently only for positive exponents)