示例#1
0
 def test_hw06_prob02_ut14(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 14 ************')
     s = '400x^5 - 6x^4 - 30x^3 + 45x^2 + 7x^1 + 10x^0'
     zr, ni = nra.zr2(s, 2.0, delta=0.0001)
     print('zr={}; num_iters={}'.format(zr, ni))
     assert nra.check_zr(s, zr, err=0.0001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 14: pass')
示例#2
0
 def test_hw06_prob02_ut20(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 20 ************')
     s = '5x^7'
     zr, ni = nra.zr2(s, 10.0, delta=0.0001)
     print('zr={}; num_iters={}'.format(zr, ni))
     assert nra.check_zr(s, zr, err=0.0000001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 20: pass')
示例#3
0
 def test_hw06_prob02_ut10(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 10 ************')
     s = '100x^4 - 2x^3 - 15x^2 - 45x^-50'
     zr, ni = nra.zr2(s, 1.0, delta=0.0001)
     print('zr={}; num_iters={}'.format(zr, ni))
     assert nra.check_zr(s, zr, err=0.0001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 10: pass')