예제 #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));
        }
예제 #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);
     }
 }
예제 #3
0
 public bool Equals([AllowNull] IFixedArith <T> other)
 {
     return(this.Number == other.Number);
 }
예제 #4
0
 public IFixedArith <T> Divide(IFixedArith <T> other)
 {
     return(new Fixed <T>((int)((((long)this.Number) << this.Fraction.Point) / other.Number), false));
 }
예제 #5
0
 public IFixedArith <T> Add(IFixedArith <T> other)
 {
     return(new Fixed <T>(this.Number + other.Number, false));
 }
예제 #6
0
 public IFixedArith <T> Subtract(IFixedArith <T> other)
 {
     return(new Fixed <T>(this.Number - other.Number, false));
 }