Beispiel #1
0
 public static PyObject __sub__(PyObject self, PyObject other)
 {
     if (other is PyInteger)
     {
         return(PyInteger.Create(extractInt(self) - extractInt(other)));
     }
     else
     {
         return(PyFloat.Create(PyFloatClass.ExtractAsDecimal(self) - PyFloatClass.ExtractAsDecimal(other)));
     }
 }
Beispiel #2
0
        public static PyObject __floordiv__(PyObject self, PyObject other)
        {
            var newPyInteger = PyInteger.Create((BigInteger)((decimal)extractInt(self) / PyFloatClass.ExtractAsDecimal(other)));

            return(newPyInteger);
        }
Beispiel #3
0
        public static PyObject __truediv__(PyObject self, PyObject other)
        {
            var newPyFloat = PyFloat.Create((decimal)extractInt(self) / PyFloatClass.ExtractAsDecimal(other));

            return(newPyFloat);
        }