Skip to content

Complex division by zero is not handled #5138

@youknowone

Description

@youknowone

Summary

Test introduced from: https://github.com/RustPython/RustPython/pull/5127/files#diff-3d5c8c4c000b7f6f9cdbedd36358b5f61686d39ff942be840e81f36c81da0ce2R248

Expected

>>> pow(0j, -1000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ZeroDivisionError: 0.0 to a negative or complex power
>>> 

Actual

>>>>> pow(0j, -1000)
0j

Note

Related RustPython code is https://github.com/RustPython/RustPython/blob/main/vm/src/builtins/complex.rs#L104-L122

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions