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.
mpmath 库似乎与 python 的其余部分一起安装:
from mpmath import *
然后想
x= mpf (65455213.0)等可能数英里之外。最终我需要对非常长的数字进行非常准确的操作,时间不是主要问题。将这样的数字与操作一起声明的正确语法是什么。
x= mpf (65455213.0)
您将 Python 浮点数传递给mpf构造函数。这意味着该数字会四舍五入到 Python 浮点数可以表示的值,在 mpmath 有机会做任何事情之前丢弃精度。
mpf
传递一个字符串:
x = mpf("65455213.0")
另外,我建议不要使用import *.
import *