如何将一个复数(例如1.9999999999999998-2j)取整为2-2j?
当我尝试使用
print(round(x,2))
Run Code Online (Sandbox Code Playgroud)
这显示了
Traceback (most recent call last):
File "C:\Python34\FFT.py", line 22, in <module>
print(round(x,2))
TypeError: type complex doesn't define __round__ method
Run Code Online (Sandbox Code Playgroud)