File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 28
28
print ((1j / 2j ).real )
29
29
print (1j / (1 + 2j ))
30
30
ans = 0j ** 0 ; print ("%.5g %.5g" % (ans .real , ans .imag ))
31
+ ans = 0j ** 1 ; print ("%.5g %.5g" % (ans .real , ans .imag ))
31
32
ans = 0j ** 0j ; print ("%.5g %.5g" % (ans .real , ans .imag ))
32
33
ans = 1j ** 2.5 ; print ("%.5g %.5g" % (ans .real , ans .imag ))
33
34
ans = 1j ** 2.5j ; print ("%.5g %.5g" % (ans .real , ans .imag ))
94
95
print ("ZeroDivisionError" )
95
96
96
97
# zero division via power
98
+ try :
99
+ 0j ** - 1
100
+ except ZeroDivisionError :
101
+ print ("ZeroDivisionError" )
97
102
try :
98
103
0j ** 1j
99
104
except ZeroDivisionError :
Original file line number Diff line number Diff line change 75
75
except ZeroDivisionError :
76
76
print ("ZeroDivisionError" )
77
77
78
+ try :
79
+ 0.0 ** - 1
80
+ except ZeroDivisionError :
81
+ print ("ZeroDivisionError" )
82
+
78
83
# unsupported unary ops
79
84
80
85
try :
Original file line number Diff line number Diff line change 2
2
1 / 0
3
3
except ZeroDivisionError :
4
4
print ("ZeroDivisionError" )
5
+
6
+ try :
7
+ 0 ** - 1
8
+ except ZeroDivisionError :
9
+ print ("ZeroDivisionError" )
You can’t perform that action at this time.
0 commit comments