Example #1
0
	def test_sin(self):
		self.assertEqual(lib.sin(0), 0)
		self.assertEqual(lib.sin(math.pi/2), 1)
		self.assertEqual(lib.sin(math.pi), 0)
		self.assertEqual(lib.sin(3*math.pi/2), -1)
		self.assertEqual(lib.sin(2*math.pi), 1)
		self.assertEqual(lib.sin(-math.pi/2), -1)
		self.assertEqual(lib.sin(-math.pi), 0)
		self.assertEqual(lib.sin(-3*math.pi/2), 1)
		self.assertEqual(lib.sin(-2*math.pi), 0)
Example #2
0
 def test_sin_positive_arg(self):
     self.assertAlmostEqual(lib.sin(0), math.sin(0))
     self.assertAlmostEqual(lib.sin(math.pi / 6), math.sin(math.pi / 6))
     self.assertAlmostEqual(lib.sin(math.pi / 4), math.sin(math.pi / 4))
     self.assertAlmostEqual(lib.sin(math.pi / 3), math.sin(math.pi / 3))
     self.assertAlmostEqual(lib.sin(math.pi / 2), math.sin(math.pi / 2))
     self.assertAlmostEqual(lib.sin(math.pi), math.sin(math.pi))
     self.assertAlmostEqual(lib.sin(3 * math.pi / 2),
                            math.sin(3 * math.pi / 2))
     self.assertAlmostEqual(lib.sin(2 * math.pi), math.sin(2 * math.pi))
     self.assertAlmostEqual(lib.sin(3 * math.pi), math.sin(3 * math.pi))
Example #3
0
 def test_sin(self):
     self.assertEqual(lib.sin(0),math.sin(0))
     self.assertEqual(lib.sin(3),math.sin(3))
     self.assertEqual(lib.sin(0),math.sin(0))
     self.assertEqual(lib.sin(math.pi),math.sin(math.pi))
     self.assertEqual(lib.sin(-3),math.sin(-3))
     self.assertEqual(lib.sin(math.pi//2),math.sin(math.pi//2))
Example #4
0
	def test_sin(self):
		self.assertEqual(lib.sin(math.pi/2), 1)
		self.assertEqual(lib.sin(-math.pi/2), -1)
		self.assertEqual(lib.sin(math.pi/6), 0.5)
Example #5
0
 def test_sqrt_non_negative_arg(self):
     # Набор проверок
     self.assertEqual(lib.sin(math.pi), 0)
     self.assertEqual(lib.sin(math.pi/2), 1)
Example #6
0
 def test_sin_negative(self):
     self.assertEqual(lib.sin(math.pi), 0)
Example #7
0
 def test2(self):
     self.assertEqual(lib.sin(math.pi / 6), 0.5)
Example #8
0
 def test5(self):
     self.assertEqual(lib.sin(3 * math.pi / 2), -1)
Example #9
0
 def test_sin_plus(self):
     self.assertEqual((lib.sin(math.pi))/1, 0)
     self.assertEqual((lib.sin(math.pi/2))/1, 1)
Example #10
0
 def test_sin_minus(self):
     self.assertEqual((lib.sin(-math.pi))/1, 0)
     self.assertEqual((lib.sin(-math.pi/2))/1, -1)
Example #11
0
 def test_sinotr(self):
     self.assertEqual(lib.sin(math.pi*(-1)/2), -1)
     self.assertEqual(lib.sin(math.pi*(-1)), 0)
     self.assertEqual(lib.sin(math.pi*(-3/2)), 1)
     self.assertEqual(lib.sin(math.pi*(-2)), 0)
Example #12
0
 def test_sinzero(self):
     self.assertEqual(lib.sin(0), 0)
Example #13
0
 def test_sinpol(self):
     self.assertEqual(lib.sin(math.pi/2), 1)
     self.assertEqual(lib.sin(math.pi), 0)
     self.assertEqual(lib.sin(math.pi*3/2), -1)
     self.assertEqual(lib.sin(math.pi*2), 0)
Example #14
0
 def test_sin(self):
     self.assertEqual(lib.sin(0), 0)
     self.assertEqual(lib.sin(math.pi), 0)
     self.assertEqual(lib.sin((math.pi)/2), 1)
     self.assertEqual(lib.sin(-(math.pi)/2), -1)
Example #15
0
 def test_equality(self):
     self.assertEqual(lib.sin(0), 0)
     self.assertEqual(lib.sin(3.1415926), 0)
     self.assertEqual(lib.sin(1.07), math.sin(1.07))
Example #16
0
 def test_lessthan1(self):
     self.assertLessEqual(lib.sin(1.58), 1)
     self.assertGreaterEqual(lib.sin(-1.58), -1)
Example #17
0
	def test_sin(self):
		self.assertEqual(lib.sin(6), math.sin(6))
		self.assertEqual(lib.sin(-math.pi/2), -1)
		self.assertEqual(lib.sin(0), 0)
		self.assertEqual(lib.sin(math.pi), 0)
		self.assertEqual(lib.sin(-math.pi/4), -1/(2**0.5))
Example #18
0
 def test_sin(self):
     self.assertEqual(lib.sin(math.pi),0)
     self.assertEqual(lib.sin(math.pi/2), 1)
     self.assertNotEqual(lib.sin(0), 1)
     self.assertNotEqual(lib.sin(18), 6)
Example #19
0
 def test_def_sin(self):
     self.assertEqual(lib.sin(math.pi),0)
     self.assertEqual(lib.sin((math.pi)/6),0.5)
     self.assertEqual(lib.sin(3/2*math.pi),-1)
Example #20
0
 def test_sin_arg(self):
     self.assertEqual(lib.sin(math.pi), 0)
     self.assertEqual(lib.sin((math.pi)/2), 1)
     self.assertEqual(lib.sin((math.pi)/(-2)),-1)
     self.assertEqual(lib.sin((math.pi)*(-1)),0)   
Example #21
0
 def test_sin_0(self):
     self.assertEqual((lib.sin(0))/1, 0)
Example #22
0
 def test_sin_1(self):
     self.assertEqual(lib.sin(35),math.sin(35)) # wront test
Example #23
0
 def test4(self):
     self.assertEqual(lib.sin(math.pi), 0)
Example #24
0
 def test_sin_2(self):
     self.assertEqual(lib.sin(-35),math.sin(-35)) # wrong test
Example #25
0
 def test1(self):
     self.assertEqual(lib.sin(0), 0)
Example #26
0
 def test_sin_error_1(self):
     self.assertAlmostEqual(lib.sin(5*math.pi/2), 1.0, msg='Функция работает некорректно для чисел не из диапазона[-2π,2π]')
Example #27
0
 def test3(self):
     self.assertEqual(lib.sin(math.pi / 2), 1)
Example #28
0
 def test_sin_error_1(self):
     self.assertAlmostEqual(
         lib.sin(5 * math.pi / 2),
         1.0,
         msg='Функция работает некорректно для чисел не из диапазона[-2π,2π]'
     )
Example #29
0
 def test_sin1_negative(self):
     self.assertEqual(lib.sin(math.pi/2), 1)
     self.assertEqual(lib.sin(math.pi/6), 0.5)
Example #30
0
 def test_sqrt_negative(self):
     # Набор проверок
     self.assertEqual(lib.sin(math.pi/6), 0.5)
Example #31
0
 def test_sin(self):
     self.assertEqual(lib.sin(0.0), 0.0)
     self.assertAlmostEqual(lib.sin(math.pi), 0.0)
     self.assertAlmostEqual(lib.sin(-math.pi), 0.0)
     self.assertAlmostEqual(lib.sin(math.pi/2), 1.0)
     self.assertAlmostEqual(lib.sin(-math.pi/2), -1.0)
Example #32
0
 def test_sin_negative_arg(self):
     self.assertAlmostEqual(lib.sin(-math.pi / 4), math.sin(-math.pi / 4))
     self.assertAlmostEqual(lib.sin(-math.pi / 2), math.sin(-math.pi / 2))
     self.assertAlmostEqual(lib.sin(-math.pi), math.sin(-math.pi))
     self.assertAlmostEqual(lib.sin(-3 * math.pi / 2),
                            math.sin(-3 * math.pi / 2))
Example #33
0
 def test_sin(self):
     self.assertEqual(lib.sin(0.0), 0.0)
     self.assertAlmostEqual(lib.sin(math.pi), 0.0)
     self.assertAlmostEqual(lib.sin(-math.pi), 0.0)
     self.assertAlmostEqual(lib.sin(math.pi / 2), 1.0)
     self.assertAlmostEqual(lib.sin(-math.pi / 2), -1.0)
Example #34
0
 def test_sin_int_negative_degrees(self):
     for n in range(360):
         x = -math.radians(n / 360)
         self.assertAlmostEqual(lib.sin(x), math.sin(x))
Example #35
0
 def sin(self):
     self.assertEqual(lib.sin(0), 0)
     self.assertEqual(lib.sin(Pi), '0')
     self.assertEqual(lib.sin(Pi/2), '1')
     self.assertEqual(lib.sin(-Pi/2), '-1')
Example #36
0
 def test_sin_random_arg(self):
     x = random.random() * 1000000
     for _ in range(100):
         self.assertAlmostEqual(lib.sin(x), math.sin(x))