

def test_pow_with_infinity(self, space):
    w_res = space.execute('return (1.0 / 0.0) ** 10')
    assert (self.unwrap(space, w_res) == float('inf'))
    w_res = space.execute('return (-1.0 / 0.0) ** 10')
    assert (self.unwrap(space, w_res) == float('inf'))
    w_res = space.execute('return (-1.0 / 0.0) ** 9')
    assert (self.unwrap(space, w_res) == (- float('inf')))
    w_res = space.execute('return (-1.0 / 0.0) ** -10')
    assert (self.unwrap(space, w_res) == 0.0)
    w_res = space.execute('return (-1.0 / 0.0) ** -9')
    assert (self.unwrap(space, w_res) == (- 0.0))
    w_res = space.execute('return 1.0 ** (1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == 1.0)
    w_res = space.execute('return (-1.0) ** (1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == (- 1.0))
    w_res = space.execute('return 1.1 ** (1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == float('inf'))
    w_res = space.execute('return (-1.1) ** (1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == float('inf'))
    w_res = space.execute('return (-0.1) ** (1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == (- 0.0))
    w_res = space.execute('return 0.1 ** (1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == 0.0)
    w_res = space.execute('return 0.1 ** (-1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == float('inf'))
    w_res = space.execute('return (-0.1) ** (-1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == float('inf'))
    w_res = space.execute('return (-2) ** (-1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == 0.0)
    w_res = space.execute('return 2 ** (-1.0 / 0.0)')
    assert (self.unwrap(space, w_res) == 0.0)
    w_res = space.execute('return 1 <=> 2')
    assert (space.int_w(w_res) == (- 1))

dataset/ETHPy150Open topazproject/topaz/tests/objects/test_floatobject.py TestFloatObject.test_pow_with_infinity/original