Exemplo n.º 1
0
        public static Rbxiaohao operator *(Rbxiaohao r1, double r2)
        {
            Rbxiaohao result = new Rbxiaohao();

            result.SetCal();
            if (r1 != null)
            {
                result.YEBAN    = (r1.YEBAN ?? 0) * r2;
                result.BAIBAN   = (r1.BAIBAN ?? 0) * r2;
                result.ZHONGBAN = (r1.ZHONGBAN ?? 0) * r2;
                result.LEIJI    = (r1.LEIJI ?? 0) * r2;
            }
            return(result);
        }
Exemplo n.º 2
0
        public static Rbxiaohao operator -(Rbxiaohao r1, Rbxiaohao r2)
        {
            Rbxiaohao result = new Rbxiaohao();

            result.SetCal();
            if (r1 != null && r2 != null)
            {
                result.YEBAN    = (r1.YEBAN ?? 0) - (r2.YEBAN ?? 0);
                result.BAIBAN   = (r1.BAIBAN ?? 0) - (r2.BAIBAN ?? 0);
                result.ZHONGBAN = (r1.ZHONGBAN ?? 0) - (r2.ZHONGBAN ?? 0);
                result.LEIJI    = (r1.LEIJI ?? 0) - (r2.LEIJI ?? 0);
            }
            return(result);
        }
Exemplo n.º 3
0
 public void GetVal(Rbxiaohao other)
 {
     if (other != null)
     {
         this.YEBAN    = other.YEBAN;
         this.BAIBAN   = other.BAIBAN;
         this.ZHONGBAN = other.ZHONGBAN;
         this.LEIJI    = other.LEIJI;
     }
     else
     {
         this.YEBAN    = null;
         this.BAIBAN   = null;
         this.ZHONGBAN = null;
         this.LEIJI    = null;
     }
 }
Exemplo n.º 4
0
        public static Rbxiaohao operator /(Rbxiaohao r1, double r2)
        {
            Rbxiaohao result = new Rbxiaohao();

            result.SetCal();
            if (r1 != null)
            {
                if (r2 > 0)
                {
                    result.YEBAN = (r1.YEBAN ?? 0) / r2;
                }
                else
                {
                    result.YEBAN = null;
                }

                if (r2 > 0)
                {
                    result.BAIBAN = (r1.BAIBAN ?? 0) / r2;
                }
                else
                {
                    result.BAIBAN = null;
                }

                if (r2 > 0)
                {
                    result.ZHONGBAN = (r1.ZHONGBAN ?? 0) / r2;
                }
                else
                {
                    result.ZHONGBAN = null;
                }

                if (r2 > 0)
                {
                    result.LEIJI = (r1.LEIJI ?? 0) / r2;
                }
                else
                {
                    result.LEIJI = null;
                }
            }
            return(result);
        }
Exemplo n.º 5
0
        public static Rbxiaohao operator /(Rbxiaohao r1, Rbxiaohao r2)
        {
            Rbxiaohao result = new Rbxiaohao();

            result.SetCal();
            if (r1 != null && r2 != null)
            {
                if (r2.YEBAN != null && r2.YEBAN != 0)
                {
                    result.YEBAN = (r1.YEBAN ?? 0) / (r2.YEBAN ?? 0);
                }
                else
                {
                    result.YEBAN = null;
                }

                if (r2.BAIBAN != null && r2.BAIBAN != 0)
                {
                    result.BAIBAN = (r1.BAIBAN ?? 0) / (r2.BAIBAN ?? 0);
                }
                else
                {
                    result.BAIBAN = null;
                }

                if (r2.ZHONGBAN != null && r2.ZHONGBAN != 0)
                {
                    result.ZHONGBAN = (r1.ZHONGBAN ?? 0) / (r2.ZHONGBAN ?? 0);
                }
                else
                {
                    result.ZHONGBAN = null;
                }

                if (r2.LEIJI != null && r2.LEIJI != 0)
                {
                    result.LEIJI = (r1.LEIJI ?? 0) / (r2.LEIJI ?? 0);
                }
                else
                {
                    result.LEIJI = null;
                }
            }
            return(result);
        }