Exemplo n.º 1
0
 public JavaScript.Object Subtract(JavaScript.Object num2)
 {
     JavaScript.Number n2 = num2 as JavaScript.Number;
     if (n2 != null)
     {
         if (this.isInt)
         {
             if (n2.isInt)
             {
                 return(Global.ConvertFromManaged(this.numL - n2.numL));
             }
             else
             {
                 return(Global.ConvertFromManaged(this.numL - n2.numD));
             }
         }
         else
         {
             if (n2.isInt)
             {
                 return(Global.ConvertFromManaged(this.numD - n2.numL));
             }
             else
             {
                 return(Global.ConvertFromManaged(this.numD - n2.numD));
             }
         }
     }
     throw new System.NotImplementedException("指定した物の減算には対応していません…");
 }
Exemplo n.º 2
0
 public JavaScript.Object Add(JavaScript.Object num2)
 {
     JavaScript.Number n2 = num2 as JavaScript.Number;
     if (n2 != null)
     {
         if (this.isInt)
         {
             if (n2.isInt)
             {
                 return(Global.ConvertFromManaged(this.numL + n2.numL));
             }
             else
             {
                 return(Global.ConvertFromManaged(this.numL + n2.numD));
             }
         }
         else
         {
             if (n2.isInt)
             {
                 return(Global.ConvertFromManaged(this.numD + n2.numL));
             }
             else
             {
                 return(Global.ConvertFromManaged(this.numD + n2.numD));
             }
         }
     }
     throw new System.NotImplementedException("文字列オブジェクトに変換して加算を実行");
 }