Пример #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();
        }
Пример #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();
        }
Пример #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();
 }
Пример #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();
 }
Пример #5
0
 bool RacketNum.RealQ(RacketNum other)
 {
     return true;
 }
Пример #6
0
 bool RacketNum.FloatQ(RacketNum other)
 {
     return false;
 }
Пример #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();
 }
Пример #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();
        }
Пример #9
0
 public bool IntegerQ(RacketNum other)
 {
     return false;
 }
Пример #10
0
 public bool ComplexQ(RacketNum other)
 {
     return false;
 }
Пример #11
0
 public ObjBox Mod(RacketNum other)
 {
     throw new InvalidOperationException("Cannot use mod operation with a complex number");
 }
Пример #12
0
 public bool greaterThan(RacketNum other)
 {
     throw new NotImplementedException();
 }
Пример #13
0
 bool RacketNum.ComplexQ(RacketNum other)
 {
     return(false);
 }
Пример #14
0
 bool RacketNum.FloatQ(RacketNum other)
 {
     return(false);
 }
Пример #15
0
 public bool FloatQ(RacketNum other)
 {
     return(true);
 }
Пример #16
0
 public bool ComplexQ(RacketNum other)
 {
     return(false);
 }
Пример #17
0
 public bool RealQ(RacketNum other)
 {
     return(true);
 }
Пример #18
0
 bool RacketNum.IntegerQ(RacketNum other)
 {
     return(true);
 }
Пример #19
0
 public bool FloatQ(RacketNum other)
 {
     return false;
 }
Пример #20
0
 public ObjBox Mod(RacketNum other)
 {
     throw new InvalidOperationException("Cannot use mod operation with a complex number");
 }
Пример #21
0
 public bool lessThanEqual(RacketNum other)
 {
     throw new NotImplementedException();
 }
Пример #22
0
 public bool RealQ(RacketNum other)
 {
     return(false);
 }
Пример #23
0
 public bool RealQ(RacketNum other)
 {
     return false;
 }
Пример #24
0
 public bool ComplexQ(RacketNum other)
 {
     return(true);
 }
Пример #25
0
 public bool FloatQ(RacketNum other)
 {
     return true;
 }
Пример #26
0
 public bool FloatQ(RacketNum other)
 {
     return(false);
 }
Пример #27
0
 public bool RealQ(RacketNum other)
 {
     return true;
 }
Пример #28
0
 public bool IntegerQ(RacketNum other)
 {
     return(false);
 }
Пример #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();
        }
Пример #30
0
 public bool lessThan(RacketNum other)
 {
     throw new NotImplementedException();
 }
Пример #31
0
 bool RacketNum.ComplexQ(RacketNum other)
 {
     return false;
 }
Пример #32
0
 public bool greaterThanEqual(RacketNum other)
 {
     throw new NotImplementedException();
 }
Пример #33
0
 bool RacketNum.IntegerQ(RacketNum other)
 {
     return true;
 }
Пример #34
0
 public bool ComplexQ(RacketNum other)
 {
     return true;
 }
Пример #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();
 }
Пример #36
0
 bool RacketNum.RealQ(RacketNum other)
 {
     return(true);
 }