Lines Matching refs:a
169 def __new__(cls, a=0, b=None): argument
170 if isinstance(a, Frac) and b is None:
171 return a
172 if isinstance(a, str) and b is None:
173 a, b = a.split('/', 1)
175 b = a
176 return super().__new__(cls, Int(a), Int(b))
179 return '%s/%s' % (self.a, self.b)
182 return float(self.a)
186 t = self.a.x/self.b.x if self.b.x else 1.0
212 return self.__class__(self.a + other.a, self.b + other.b)
215 return self.__class__(self.a - other.a, self.b - other.b)
218 return self.__class__(self.a * other.a, self.b + other.b)
221 self_t = self.a.x/self.b.x if self.b.x else 1.0
222 other_t = other.a.x/other.b.x if other.b.x else 1.0
223 return (self_t, self.a.x) < (other_t, other.a.x)