Ejemplo n.º 1
0
 public static object div(IVariable arg1, IVariable arg2)
 {
     if(arg1.getType() != arg2.getType()) {
     throw new Exception("Argument types differ.");
       }
       if(arg1.getType() == typeof(decimal)) {
     return arg1.getValue<decimal>() / arg2.getValue<decimal>();
       }
       else if(arg1.getType() == typeof(float)) {
     return arg1.getValue<float>() / arg2.getValue<float>();
       }
       else {
     throw new Exception("Invalid argument types.");
       }
 }