Esempio n. 1
0
    public static FixNum operator -(FixNum a, FixNum b)
    {
        FixNum res = new FixNum
        {
            _value = a._value - b._value
        };

        return(res);
    }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
    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);
    }
Esempio n. 4
0
 public static void Print(FixNum value) => Console.WriteLine(value.ToDouble());