public static FixNum operator -(FixNum a, FixNum b) { FixNum res = new FixNum { _value = a._value - b._value }; return(res); }
static void Main(string[] args) { FixNum fn = new FixNum(15); FixNum.Print(fn); FixNum fn2 = fn / new FixNum(7.0); FixNum.Print(fn2); Console.WriteLine(fn2 * new FixNum(7)); Console.WriteLine(fn / fn2); Console.ReadLine(); }
public static FixNum operator /(FixNum a, FixNum b) { Int64 newvalue = a._value; newvalue <<= range; newvalue /= b._value; FixNum res = new FixNum { _value = (int)newvalue }; return(res); }
public static void Print(FixNum value) => Console.WriteLine(value.ToDouble());