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

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