Beispiel #1
0
    def test_maximum(self):
        from numpypy import array, maximum

        a = array([-5.0, -0.0, 1.0])
        b = array([ 3.0, -2.0,-3.0])
        c = maximum(a, b)
        for i in range(3):
            assert c[i] == max(a[i], b[i])

        x = maximum(2, 3)
        assert x == 3
        assert isinstance(x, (int, long))
Beispiel #2
0
    def test_maximum(self):
        from numpypy import array, maximum, nan, isnan

        a = array([-5.0, -0.0, 1.0])
        b = array([ 3.0, -2.0,-3.0])
        c = maximum(a, b)
        for i in range(3):
            assert c[i] == max(a[i], b[i])

        arg1 = array([0, nan, nan])
        arg2 = array([nan, 0, nan])
        assert isnan(maximum(arg1, arg2)).all()

        x = maximum(2, 3)
        assert x == 3
        assert isinstance(x, (int, long))
Beispiel #3
0
    def test_maximum(self):
        from numpypy import array, maximum

        a = array([-5.0+5j, -5.0-5j, -0.0-10j, 1.0+10j])
        b = array([ 3.0+10.0j, 3.0, -2.0+2.0j, -3.0+4.0j])
        c = maximum(a, b)
        for i in range(4):
            assert c[i] == max(a[i], b[i])