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.
当在python中再次对平方根值进行平方时,如何获得初始值?
例如 :
np.square((np.sqrt(2)))
但终端给出了'2.0000000000000004'。
我的意见是先将值平方,但是可以在此代码表示中进行任何更正吗?
>>> round(np.square((np.sqrt(2))), 2) 2.0