Example #1
0
 public SimpleBigDecimal Add(SimpleBigDecimal b)
 {
     CheckScale(b);
     return(new SimpleBigDecimal(bigInt.Add(b.bigInt), scale));
 }
Example #2
0
 private SimpleBigDecimal(SimpleBigDecimal limBigDec)
 {
     bigInt = limBigDec.bigInt;
     scale  = limBigDec.scale;
 }
Example #3
0
        public BigInteger Round()
        {
            SimpleBigDecimal oneHalf = new SimpleBigDecimal(BigInteger.One, 1);

            return(Add(oneHalf.AdjustScale(scale)).Floor());
        }
Example #4
0
 public int CompareTo(SimpleBigDecimal val)
 {
     CheckScale(val);
     return(bigInt.CompareTo(val.bigInt));
 }
Example #5
0
 public SimpleBigDecimal Multiply(SimpleBigDecimal b)
 {
     CheckScale(b);
     return(new SimpleBigDecimal(bigInt.Multiply(b.bigInt), scale + scale));
 }
Example #6
0
 public SimpleBigDecimal Subtract(SimpleBigDecimal b)
 {
     return(Add(b.Negate()));
 }