public SimpleBigDecimal Add(SimpleBigDecimal b) { CheckScale(b); return(new SimpleBigDecimal(bigInt.Add(b.bigInt), scale)); }
private SimpleBigDecimal(SimpleBigDecimal limBigDec) { bigInt = limBigDec.bigInt; scale = limBigDec.scale; }
public BigInteger Round() { SimpleBigDecimal oneHalf = new SimpleBigDecimal(BigInteger.One, 1); return(Add(oneHalf.AdjustScale(scale)).Floor()); }
public int CompareTo(SimpleBigDecimal val) { CheckScale(val); return(bigInt.CompareTo(val.bigInt)); }
public SimpleBigDecimal Multiply(SimpleBigDecimal b) { CheckScale(b); return(new SimpleBigDecimal(bigInt.Multiply(b.bigInt), scale + scale)); }
public SimpleBigDecimal Subtract(SimpleBigDecimal b) { return(Add(b.Negate())); }