Esempio n. 1
0
 def test_frexp(self):
     """tests if the frexp function works"""
     a = simplearray.array(test_sample).fill_arange()/10  
     b = cumath.frexp(a)
 
     first = b[0]
     second = b[1]    
     
     for i in range(test_sample):
         c = math.frexp(a[i])
         
         self.assert_(c[0] == first[i])
         self.assert_(c[1] == second[i])
Esempio n. 2
0
    def test_frexp(self):
        """tests if the frexp function works"""
        for s in sizes:
            a = gpuarray.arange(s, dtype=np.float32) / 10
            significands, exponents = cumath.frexp(a)

            a = a.get()
            significands = significands.get()
            exponents = exponents.get()

            for i in range(s):
                sig_true, ex_true = math.frexp(a[i])

                assert sig_true == significands[i]
                assert ex_true == exponents[i]
Esempio n. 3
0
    def test_frexp(self):
        """tests if the frexp function works"""
        for s in sizes:
            a = gpuarray.arange(s, dtype=np.float32)/10
            significands, exponents = cumath.frexp(a)

            a = a.get()
            significands = significands.get()
            exponents = exponents.get()

            for i in range(s):
                sig_true, ex_true = math.frexp(a[i])

                assert sig_true == significands[i]
                assert ex_true == exponents[i]