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.
CL-USER> (exp 1) 2.7182817
Why? It should be 2.7182818 (rounded from 2.7182818284590452353602874713526624977572470936999595749669...)
SBCL 1.0.29.11.debian
这是 IEEE 单浮点格式固有的舍入误差。
CL-USER> (exp 1.0d0) 2.718281828459045d0
在这篇经典论文 (PDF) 中了解有关浮点运算及其“问题”的更多信息:
每个计算机科学家都应该知道的关于浮点运算的知识