コード例 #1
0
 public FloatVal(NumVal v)
 {
     if (typeof(FloatVal).IsInstanceOfType(v))
     {
         floatVal = (float)(((IntVal)v).intVal);
     }
     else if (typeof(FloatVal).IsInstanceOfType(v))
     {
         floatVal = (((FloatVal)v).floatVal);
     }
     else
     {
         throw new TypeMismatchException("this error should never occur! Must be wrong class that implements numVal");
     }
 }
コード例 #2
0
 //finish this method
 public int Compare(NumVal other)
 {
     return(0);
 }