如何舍入一个复数?
发布于 2021-01-29 14:11:08
如何将一个复数(例如1.9999999999999998-2j
)取整为2-2j
?
当我尝试使用
print(round(x,2))
这显示了
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
关注者
0
被浏览
114
1 个回答