def float_mod(a, b): y = b.number mod = math_fmod(a.number, y) # Follows pypy implementation. if mod: # I'm not sure why remainder and denominator if (y < 0.0) != (mod < 0.0): # must have the same sign. mod += y else: mod = copysign(0.0, y) return Float(mod)
def _(a, b): return Float(operation(a.number, b.number))
def _(a): return Float(+a.number)
def _(a, b): return List([a, Float(float(b.value))])
def _(a, b): return List([Float(float(a.value)), b])
def _(a, b): return Float(math.floor(a.number / b.number))
def _(a, b): return Float(a.number / b.number)
def _(a, b): return Float(float(a.value) / float(b.value))
def is_right_unbounded(self): """Return ``True`` if the right endpoint is positive infinity. """ return self.right is S.Infinity or self.right == Float("+inf")
def is_left_unbounded(self): """Return ``True`` if the left endpoint is negative infinity. """ return self.left is S.NegativeInfinity or self.left == Float("-inf")