|
51 | 51 | ('atan2', atan2, ((1., 0.), (0., 1.), (2., 0.5), (-3., 5.), (-3., -4.),)), |
52 | 52 | ('fmod', fmod, ((1., 1.), (0., 1.), (2., 0.5), (-3., 5.), (-3., -4.),)), |
53 | 53 | ('ldexp', ldexp, ((1., 0), (0., 1), (2., 2), (3., -2), (-3., -4),)), |
54 | | - ('log', log, ((2., 2.), (3., 2.), (4., 5.), (0., 1.), (1., 0.), (-1., 1.), (1., -1.))), |
| 54 | + ('log', log, ((2., 2.), (3., 2.), (4., 5.), (0., 1.), (1., 0.), (-1., 1.), (1., -1.), (2., 1.))), |
55 | 55 | ] |
56 | 56 |
|
57 | 57 | for function_name, function, test_vals in binary_functions: |
58 | 58 | print(function_name) |
59 | 59 | for value1, value2 in test_vals: |
60 | 60 | try: |
61 | 61 | print("{:.5g}".format(function(value1, value2))) |
62 | | - except ValueError as e: |
63 | | - print(str(e)) |
| 62 | + except (ValueError, ZeroDivisionError) as e: |
| 63 | + print(type(e)) |
0 commit comments