Пример #1
0
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)
Пример #2
0
 def _(a, b):
     return Float(operation(a.number, b.number))
Пример #3
0
def _(a):
    return Float(+a.number)
Пример #4
0
def _(a, b):
    return List([a, Float(float(b.value))])
Пример #5
0
def _(a, b):
    return List([Float(float(a.value)), b])
Пример #6
0
def _(a, b):
    return Float(math.floor(a.number / b.number))
Пример #7
0
def _(a, b):
    return Float(a.number / b.number)
Пример #8
0
def _(a, b):
    return Float(float(a.value) / float(b.value))
Пример #9
0
 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")
Пример #10
0
 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")