public void ToBigInteger() { BigDecimal sub1 = BigDecimal.Parse("-29830.989"); BigInteger result = sub1.ToBigInteger(); Assert.IsTrue(result.ToString().Equals("-29830"), "the bigInteger equivalent of -29830.989 is wrong"); sub1 = new BigDecimal(-2837E10); result = sub1.ToBigInteger(); Assert.IsTrue(result.ToDouble() == -2837E10, "the bigInteger equivalent of -2837E10 is wrong"); sub1 = new BigDecimal(2.349E-10); result = sub1.ToBigInteger(); Assert.IsTrue(result.Equals(BigInteger.Zero), "the bigInteger equivalent of 2.349E-10 is wrong"); sub1 = new BigDecimal(value2, 6); result = sub1.ToBigInteger(); Assert.IsTrue(result.ToString().Equals("12334"), "the bigInteger equivalent of 12334.560000 is wrong"); }