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))); } }
public static PyObject __floordiv__(PyObject self, PyObject other) { var newPyInteger = PyInteger.Create((BigInteger)((decimal)extractInt(self) / PyFloatClass.ExtractAsDecimal(other))); return(newPyInteger); }
public static PyObject __truediv__(PyObject self, PyObject other) { var newPyFloat = PyFloat.Create((decimal)extractInt(self) / PyFloatClass.ExtractAsDecimal(other)); return(newPyFloat); }