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

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