示例#1
0
 def test_hw06_prob02_ut19(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 19 ************')
     s = '5x^7'
     zr = nra.zr1(s, 5.0, num_iters=30)
     print('zr={}'.format(zr))
     assert nra.check_zr(s, zr, err=0.0000001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 19: pass')
示例#2
0
 def test_hw06_prob02_ut15(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 15 ************')
     s = '2x^1'
     zr = nra.zr1(s, 10.0, num_iters=5)
     print('zr={}'.format(zr))
     assert nra.check_zr(s, zr, err=0.0001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 15: pass')
示例#3
0
 def test_hw06_prob02_ut09(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 09 ************')
     s = '100x^4 - 2x^3 - 15x^2 - 45x^-50'
     zr = nra.zr1(s, 1.0, num_iters=10)
     print('zr={}'.format(zr))
     assert nra.check_zr(s, zr, err=0.0001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 09: pass')
示例#4
0
 def test_hw06_prob02_ut13(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 13 ************')
     s = '400x^5 - 6x^4 - 30x^3 + 45x^2 + 7x^1 + 10x^0'
     zr = nra.zr1(s, 2.0, num_iters=15)
     print('zr={}'.format(zr))
     assert nra.check_zr(s, zr, err=0.0001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 13: pass')
示例#5
0
 def test_hw06_prob02_ut07(self):
     print(
         '\n***** CS3430: S20: HW06: Problem 02: Unit Test 07 ************')
     s = '1x^2 - 3x^0'
     zr = nra.zr1(s, 1.0, num_iters=10)
     print('zr={}'.format(zr))
     assert nra.check_zr(s, zr, err=0.0001)
     print('CS 3430: S20: HW06: Problem 02: Unit Test 07: pass')