示例#1
0
 def __lt__(self, other):
     other = Basic.sympify(other)
     if isinstance(other, NumberSymbol):
         return other.__ge__(self)
     if other.is_comparable: other = other.evalf()
     if isinstance(other, Number):
         return bool(self._as_decimal() < other._as_decimal())
     return RelMeths.__lt__(self, other)
示例#2
0
 def __lt__(self, other):
     other = Basic.sympify(other)
     if isinstance(other, NumberSymbol):
         return other.__ge__(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.__lt__(self, other)
示例#3
0
 def __lt__(self, other):
     other = Basic.sympify(other)
     if self is other: return False
     if isinstance(other, Number):
         approx = self.approximation_interval(other.__class__)
         if approx is not None:
             l,u = approx
             if other < l: return False
             if other > u: return True
         return self.evalf()<other
     if other.is_comparable:
         other = other.evalf()
         return self.evalf()<other
     return RelMeths.__lt__(self, other)