Exemplo n.º 1
0
        public IFixedArith <T> Multiply(IFixedArith <T> other)
        {
            long thisNumber = this.Number;

            thisNumber  *= other.Number;
            thisNumber >>= Fraction.Point;
            return(new Fixed <T>((int)thisNumber, false));
        }
Exemplo n.º 2
0
 public int CompareTo([AllowNull] IFixedArith <T> other)
 {
     if (this.Number < other.Number)
     {
         return(-1);
     }
     else if (this.Number == other.Number)
     {
         return(0);
     }
     else
     {
         return(1);
     }
 }
Exemplo n.º 3
0
 public bool Equals([AllowNull] IFixedArith <T> other)
 {
     return(this.Number == other.Number);
 }
Exemplo n.º 4
0
 public IFixedArith <T> Divide(IFixedArith <T> other)
 {
     return(new Fixed <T>((int)((((long)this.Number) << this.Fraction.Point) / other.Number), false));
 }
Exemplo n.º 5
0
 public IFixedArith <T> Add(IFixedArith <T> other)
 {
     return(new Fixed <T>(this.Number + other.Number, false));
 }
Exemplo n.º 6
0
 public IFixedArith <T> Subtract(IFixedArith <T> other)
 {
     return(new Fixed <T>(this.Number - other.Number, false));
 }