public void SumLongInteger_Positives() { var result = LongIntegerMath.SumLongInteger(LongInteger.Parse("86754358512222876"), LongInteger.Parse("28076")); Assert.AreEqual(LongInteger.Parse("86754358512250952"), result); }
public void DivisionIntoSmall_NegativeAtZero() { var result = LongIntegerMath.DivisionIntoSmall(LongInteger.Parse("-78652868637835437863"), 0); Assert.AreEqual(new InfinityLongNumber(true), result); }
public void DivisionIntoSmall_NegativeAtNegativeOne() { var result = LongIntegerMath.DivisionIntoSmall(LongInteger.Parse("-78652868637835437863"), -1); Assert.AreEqual(LongInteger.Parse("78652868637835437863"), result); }
public void DivisionLongInteger_NegativeAtZero() { var result = LongIntegerMath.DivisionLongInteger(LongInteger.Parse("-86754358512222876"), LongInteger.Parse("0")); Assert.AreEqual(new InfinityLongNumber(true), result); }
public void DivisionLongInteger_Negatives() { var result = LongIntegerMath.DivisionLongInteger(LongInteger.Parse("-86754358512222876"), LongInteger.Parse("-16378578")); Assert.AreEqual(LongInteger.Parse("5296818717"), result); }
public void Power_PositiveAtPositiveExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("1675"), LongInteger.Parse("51")); Assert.AreEqual(LongInteger.Parse("265922680624065947983569107236030250425751686180815786236546454206212173641431223389225987377498639067833261257629765057677699580107599786060745827853679656982421875"), result); }
public void Power_NegativeAtNegativeFirstExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("-86754"), LongInteger.Parse("-1")); Assert.AreEqual(LongInteger.Parse("-0.00001152684"), result); }
public void Compare_Negatives_SecondLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("-85157"), LongInteger.Parse("-78557")); Assert.IsTrue(result < 0); }
public void Compare_Positive_FirstLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("98895"), LongInteger.Parse("85557")); Assert.IsTrue(result > 0); }
public void Compare_DifferentSign() { var result = LongIntegerMath.Compare(LongInteger.Parse("-8567"), LongInteger.Parse("8567")); Assert.IsTrue(result < 0); }
public void Compare_Negatives_FirstLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("-78895"), LongInteger.Parse("-85557")); Assert.IsTrue(result > 0); }
public void SumLongInteger_EqualValues() { var result = LongIntegerMath.SumLongInteger(LongInteger.Parse("28076"), LongInteger.Parse("28076")); Assert.AreEqual(LongInteger.Parse("56152"), result); }
public void SumLongInteger_DifferentSign_SecondNegative() { var result = LongIntegerMath.SumLongInteger(LongInteger.Parse("8675435851876"), LongInteger.Parse("-28076")); Assert.AreEqual(LongInteger.Parse("8675435823800"), result); }
[TestMethod] public void SumLongInteger_Negatives() { var result = LongIntegerMath.SumLongInteger(LongInteger.Parse("-86754358512222876"), LongInteger.Parse("-28076")); Assert.AreEqual(LongInteger.Parse("-86754358512250952"), result); }
public void Power_NegativeAtEvenPositiveExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("-1675"), LongInteger.Parse("52")); Assert.AreEqual(LongInteger.Parse("445420490045310462872478254620350669463134074352866441946215310795405390849397299176953528857310220438620712606529856471610146796680229641651749261654913425445556640625"), result); }
public void Compare_Positive_SecondLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("85157"), LongInteger.Parse("88557")); Assert.IsTrue(result < 0); }
public void Power_PositiveAtNegativeSecondExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("86754"), LongInteger.Parse("-2")); Assert.AreEqual(LongIntegerMath.DivisionLongInteger(LongInteger.Parse("1"), LongIntegerMath.Power(LongInteger.Parse("86754"), LongInteger.Parse("2")) as LongInteger), result); }
public void Compare_NegativeDifferentLength_SecondLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("-988852945965292398595"), LongInteger.Parse("-8557")); Assert.IsTrue(result < 0); }
public void Power_NegativeAtFirstExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("-8675435878387378512222876"), LongInteger.Parse("1")); Assert.AreEqual(LongInteger.Parse("-8675435878387378512222876"), result); }
public void Compare_PositiveDifferentLength_FirstLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("859529395263915725"), LongInteger.Parse("88557")); Assert.IsTrue(result > 0); }
public void Power_NegativeAtSecondExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("-8675435878387378512222876"), LongInteger.Parse("2")); Assert.AreEqual(LongInteger.Parse("75263187680010985770759262077222264890530697711376"), result); }
public void Compare_PositiveDifferentCount_SecondLarger() { var result = LongIntegerMath.Compare(LongInteger.Parse("851"), LongInteger.Parse("85649679898888648557")); Assert.IsTrue(result < 0); }
public void DivisionLongInteger_NegativeAtNegativeOne() { var result = LongIntegerMath.DivisionLongInteger(LongInteger.Parse("-86754358512222876"), LongInteger.Parse("-1")); Assert.AreEqual(LongInteger.Parse("86754358512222876"), result); }
public void Compare_PositiveEqualFirstPart() { var result = LongIntegerMath.Compare(LongInteger.Parse("85122228767945"), LongInteger.Parse("85122228767456")); Assert.IsTrue(result > 0); }
public void DivisionLongInteger_Negatives_SecondLonger() { var result = LongIntegerMath.DivisionLongInteger(LongInteger.Parse("-16378"), LongInteger.Parse("-86754358")); Assert.AreEqual(LongInteger.Parse("0"), result); }
public void Compare_PositiveEquals() { var result = LongIntegerMath.Compare(LongInteger.Parse("8512222876"), LongInteger.Parse("8512222876")); Assert.AreEqual(0, result); }
public void DivisionLongInteger_DifferentSign_SecondNegative() { var result = LongIntegerMath.DivisionLongInteger(LongInteger.Parse("86754358512222876"), LongInteger.Parse("-16378578")); Assert.AreEqual(LongInteger.Parse("-5296818717"), result); }
public void Power_PositiveAtZeroExponent() { var result = LongIntegerMath.Power(LongInteger.Parse("8675435878387378512222876"), LongInteger.Parse("0")); Assert.AreEqual(LongInteger.Parse("1"), result); }
public void DivisionIntoSmall_AtTwo() { var result = LongIntegerMath.DivisionIntoSmall(LongInteger.Parse("78652868637835437863"), 2); Assert.AreEqual(LongInteger.Parse("39326434318917718931"), result); }
public void SubstructLongInteger_EqualValues_DifferentSign_SecondNegative() { var result = LongIntegerMath.SubstructLongInteger(LongInteger.Parse("56152"), LongInteger.Parse("-56152")); Assert.AreEqual(LongInteger.Parse("112304"), result); }