Ejemplo n.º 1
0
        public bool lessThan(RacketNum other)
        {
            if (other.GetType() == typeof(RacketInt))
            {
                return(this.value < ((RacketInt)other).value);
            }
            if (other.GetType() == typeof(RacketFloat))
            {
                return(this.value < ((RacketFloat)other).value);
            }

            throw new NotImplementedException();
        }
Ejemplo n.º 2
0
        public bool greaterThanEqual(RacketNum other)
        {
            if (other.GetType() == typeof(RacketInt))
            {
                return(this.value >= ((RacketInt)other).value);
            }
            if (other.GetType() == typeof(RacketFloat))
            {
                return(this.value >= ((RacketFloat)other).value);
            }

            throw new NotImplementedException();
        }
Ejemplo n.º 3
0
 public ObjBox Div(RacketNum other)
 {
     if (other.GetType() == typeof(RacketComplex))
     {
         return(new ObjBox(new RacketComplex(value / ((RacketComplex)other).value), typeof(RacketComplex)));
     }
     if (other.GetType() == typeof(RacketInt))
     {
         return(new ObjBox(new RacketComplex(value / ((RacketInt)other).value), typeof(RacketComplex)));
     }
     if (other.GetType() == typeof(RacketFloat))
     {
         return(new ObjBox(new RacketComplex(value / ((RacketFloat)other).value), typeof(RacketComplex)));
     }
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
 public ObjBox Mod(RacketNum other)
 {
     if (other.GetType() == typeof(RacketFloat))
     {
         return(new ObjBox(new RacketFloat(value % ((RacketFloat)other).value), typeof(RacketFloat)));
     }
     if (other.GetType() == typeof(RacketInt))
     {
         return(new ObjBox(new RacketFloat(value % ((RacketInt)other).value), typeof(RacketFloat)));
     }
     if (other.GetType() == typeof(RacketComplex))
     {
         throw new InvalidOperationException("Cannot use mod operation with a complex number");
     }
     throw new NotImplementedException();
 }
Ejemplo n.º 5
0
 bool RacketNum.RealQ(RacketNum other)
 {
     return true;
 }
Ejemplo n.º 6
0
 bool RacketNum.FloatQ(RacketNum other)
 {
     return false;
 }
Ejemplo n.º 7
0
 public ObjBox Mod(RacketNum other)
 {
     if (other.GetType() == typeof(RacketInt))
     {
         return new ObjBox(new RacketInt(value % ((RacketInt)other).value), typeof(RacketInt));
     }
     if (other.GetType() == typeof(RacketFloat))
     {
         return new ObjBox(new RacketFloat(value % ((RacketFloat)other).value), typeof(RacketFloat));
     }
     if (other.GetType() == typeof(RacketComplex))
     {
         throw new InvalidOperationException("Cannot use mod operation with a complex number");
     }
     throw new NotImplementedException();
 }
Ejemplo n.º 8
0
        public bool greaterThan(RacketNum other)
        {
            if (other.GetType() == typeof(RacketInt))
                return this.value > ((RacketInt)other).value;
            if (other.GetType() == typeof(RacketFloat))
                return this.value > ((RacketFloat)other).value;

            throw new NotImplementedException();
        }
Ejemplo n.º 9
0
 public bool IntegerQ(RacketNum other)
 {
     return false;
 }
Ejemplo n.º 10
0
 public bool ComplexQ(RacketNum other)
 {
     return false;
 }
Ejemplo n.º 11
0
 public ObjBox Mod(RacketNum other)
 {
     throw new InvalidOperationException("Cannot use mod operation with a complex number");
 }
Ejemplo n.º 12
0
 public bool greaterThan(RacketNum other)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 13
0
 bool RacketNum.ComplexQ(RacketNum other)
 {
     return(false);
 }
Ejemplo n.º 14
0
 bool RacketNum.FloatQ(RacketNum other)
 {
     return(false);
 }
Ejemplo n.º 15
0
 public bool FloatQ(RacketNum other)
 {
     return(true);
 }
Ejemplo n.º 16
0
 public bool ComplexQ(RacketNum other)
 {
     return(false);
 }
Ejemplo n.º 17
0
 public bool RealQ(RacketNum other)
 {
     return(true);
 }
Ejemplo n.º 18
0
 bool RacketNum.IntegerQ(RacketNum other)
 {
     return(true);
 }
Ejemplo n.º 19
0
 public bool FloatQ(RacketNum other)
 {
     return false;
 }
Ejemplo n.º 20
0
 public ObjBox Mod(RacketNum other)
 {
     throw new InvalidOperationException("Cannot use mod operation with a complex number");
 }
Ejemplo n.º 21
0
 public bool lessThanEqual(RacketNum other)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 22
0
 public bool RealQ(RacketNum other)
 {
     return(false);
 }
Ejemplo n.º 23
0
 public bool RealQ(RacketNum other)
 {
     return false;
 }
Ejemplo n.º 24
0
 public bool ComplexQ(RacketNum other)
 {
     return(true);
 }
Ejemplo n.º 25
0
 public bool FloatQ(RacketNum other)
 {
     return true;
 }
Ejemplo n.º 26
0
 public bool FloatQ(RacketNum other)
 {
     return(false);
 }
Ejemplo n.º 27
0
 public bool RealQ(RacketNum other)
 {
     return true;
 }
Ejemplo n.º 28
0
 public bool IntegerQ(RacketNum other)
 {
     return(false);
 }
Ejemplo n.º 29
0
        public bool lessThanEqual(RacketNum other)
        {
            if (other.GetType() == typeof(RacketInt))
                return this.value <= ((RacketInt)other).value;
            if (other.GetType() == typeof(RacketFloat))
                return this.value <= ((RacketFloat)other).value;

            throw new NotImplementedException();
        }
Ejemplo n.º 30
0
 public bool lessThan(RacketNum other)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 31
0
 bool RacketNum.ComplexQ(RacketNum other)
 {
     return false;
 }
Ejemplo n.º 32
0
 public bool greaterThanEqual(RacketNum other)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 33
0
 bool RacketNum.IntegerQ(RacketNum other)
 {
     return true;
 }
Ejemplo n.º 34
0
 public bool ComplexQ(RacketNum other)
 {
     return true;
 }
Ejemplo n.º 35
0
 public ObjBox Sub(RacketNum other)
 {
     if (other.GetType() == typeof(RacketInt))
     {
         return new ObjBox(new RacketInt(value - ((RacketInt)other).value), typeof(RacketInt));
     }
     if (other.GetType() == typeof(RacketFloat))
     {
         return new ObjBox(new RacketFloat(value - ((RacketFloat)other).value), typeof(RacketFloat));
     }
     if (other.GetType() == typeof(RacketComplex))
     {
         return new ObjBox(new RacketComplex(value - ((RacketComplex)other).value), typeof(RacketComplex));
     }
     throw new NotImplementedException();
 }
Ejemplo n.º 36
0
 bool RacketNum.RealQ(RacketNum other)
 {
     return(true);
 }