示例#1
0
    def test_signbit(self):
        from _numpypy import signbit, copysign

        assert (signbit([0, 0.0, 1, 1.0, float('inf'), float('nan')]) ==
            [False, False, False, False, False, False]).all()
        assert (signbit([-0, -0.0, -1, -1.0, float('-inf'), -float('nan'), float('-nan')]) ==
            [False,  True,  True,  True,  True,  True, True]).all()
示例#2
0
    def test_signbit(self):
        from _numpypy import signbit

        assert (signbit([0, 0.0, 1, 1.0, float("inf")]) == [False, False, False, False, False]).all()
        assert (signbit([-0, -0.0, -1, -1.0, float("-inf")]) == [False, True, True, True, True]).all()
        skip("sign of nan is non-determinant")
        assert (signbit([float("nan"), float("-nan"), -float("nan")]) == [False, True, True]).all()
示例#3
0
    def test_signbit(self):
        from _numpypy import signbit

        assert (signbit([0, 0.0, 1, 1.0, float('inf')]) ==
            [False, False, False, False, False]).all()
        assert (signbit([-0, -0.0, -1, -1.0, float('-inf')]) ==
            [False,  True,  True,  True,  True]).all()
        skip('sign of nan is non-determinant')
        assert (signbit([float('nan'), float('-nan'), -float('nan')]) ==
            [False, True, True]).all()    
示例#4
0
    def test_signbit(self):
        from _numpypy import signbit

        assert (signbit([0, 0.0, 1, 1.0,
                         float('inf')]) == [False, False, False, False,
                                            False]).all()
        assert (signbit([-0, -0.0, -1, -1.0,
                         float('-inf')]) == [False, True, True, True,
                                             True]).all()
        skip('sign of nan is non-determinant')
        assert (signbit([float('nan'),
                         float('-nan'), -float('nan')]) == [False, True,
                                                            True]).all()