Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
numpy 或 scipy 模块中是否有任何 epsilon 常数(如在 Matlab 中)来比较浮点数?
您可以使用np.finfo
>>> import numpy as np >>> np.finfo(np.double).eps 2.2204460492503131e-16 >>> np.finfo(np.single).eps 1.1920929e-07