McTwist / BigInteger.cs

Port of BigInteger.js to TorqueScript
1 stars 1 forks source link

Use negative numbers in math #4

Open Permamiss opened 4 years ago

Permamiss commented 4 years ago

Adds functionality for negative numbers to be correctly represented in results for addition, subtraction, multiplication and division. Tested and working without issue.

Example:

%x = BigInt(999);
%y = BigInt(1000);
%z = %x.subtract(%y);
echo(%z.toString());
> -1

Previously, this would result in 999.

Permamiss commented 4 years ago

This resolves #1 .

McTwist commented 4 years ago

This PR is going against #3, as you add the same file again that was added there. Make multiple PR with less commits to make this easier for me.