Beispiel #1
0
 public static Shever operator !(Shever a)
 {
     Shever b = new Shever();
     b.Mana = 0;
     b.Mone = a.Mahane;
     b.Mahane = a.Mana * a.Mahane + a.Mone;
     b.Tsimtsum();
     return b;
 }
Beispiel #2
0
        /// <summary>
        /// calculate the fragment plus fragment
        /// </summary>
        /// <param name="a">First fragment</param>
        /// <param name="b">Secend fragment</param>
        public static double operator +(Shever a, Shever b)
        {
            Shever c = new Shever();
            c.Mana = a.Mana + b.Mana;
            c.Mahane = a.Mahane * b.Mahane;
            c.Mone = a.Mone * b.Mahane + a.Mahane * b.Mone;
            c.Tsimtsum();

            if (a.ToDouble() + b.ToDouble() != c.ToDouble())
            {
                throw new System.Exception("problem with parsing to double : " + a.ToString() + "@" + b.ToString() + "@" + c.ToString());
            }
            return c.ToDouble();
        }