def __le__(self, other): other = Basic.sympify(other) if self is other: return True if other.is_comparable: other = other.evalf() if isinstance(other, Number): return self.evalf()<=other return RelMeths.__le__(self, other)
def __le__(self, other): other = Basic.sympify(other) if isinstance(other, NumberSymbol): return other.__gt__(self) if other.is_comparable: other = other.evalf() if isinstance(other, Number): return bool(self._as_decimal()<=other._as_decimal()) return RelMeths.__le__(self, other)
def __le__(self, other): other = Basic.sympify(other) if isinstance(other, NumberSymbol): return other.__gt__(self) if other.is_comparable and not isinstance(other, Rational): other = other.evalf() if isinstance(other, Number): if isinstance(other, Real): return bool(self._as_decimal()<=other._as_decimal()) return bool(self.p * other.q <= self.q * other.p) return RelMeths.__le__(self, other)