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 的解释器,使其可以使用本机(c)任意精度库,以便 Python 可以像使用普通数字一样使用任意精度,而不必使用小数类?
例如。
>>0.00000001 + 1 1.00000001
如果您对 builtin 不满意decimal,可以尝试几个实现更高精度浮点数的库。然而,它们中的大多数并不完全是“本地的”——你可能会澄清你的意思以及你为什么需要它。
decimal
ctypes