diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-04-27 20:54:50 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-04-28 21:38:41 +0100 |
| commit | 5bdef288372d3a6a8134479a6497c44f3b17c4dc (patch) | |
| tree | faac4e716212c78394b7b982e13f916cb6523d7f /dotnet/Mammoth/Couscous/java/math/BigInteger.cs | |
| parent | f8ace2ab808441e55ffc95634bc8b88575de78ca (diff) | |
Replace parboiled parser with hand-written parser
Diffstat (limited to 'dotnet/Mammoth/Couscous/java/math/BigInteger.cs')
| -rw-r--r-- | dotnet/Mammoth/Couscous/java/math/BigInteger.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/dotnet/Mammoth/Couscous/java/math/BigInteger.cs b/dotnet/Mammoth/Couscous/java/math/BigInteger.cs new file mode 100644 index 0000000..40ac3d3 --- /dev/null +++ b/dotnet/Mammoth/Couscous/java/math/BigInteger.cs @@ -0,0 +1,24 @@ +namespace Mammoth.Couscous.java.math { + internal class BigInteger { + internal static readonly BigInteger _ONE = new BigInteger(1); + + // TOOD: use proper BigInteger + private readonly long _value; + + internal BigInteger(string value) { + _value = long.Parse(value); + } + + internal BigInteger(long value) { + _value = value; + } + + internal BigInteger subtract(BigInteger other) { + return new BigInteger(_value - other._value); + } + + internal string toString() { + return _value.ToString(); + } + } +} |
