了解浮点算术最初发表在1991年3月的计算调查中的期刊。 (ACM期刊)。它解释了为什么你没有从浮点数得到绝对准确的结果。 http://docs.sun.com/source/806-3568/ncg_goldberg.html - Lew Pitcher Master Code Code& JOAT-in-training |已注册的Linux用户#112576 http://pitcher.digitalfreehold.ca/ |可根据要求提供GPG公钥 ---------- Slackware - 因为我知道我在做什么。 ------Hi, BalaYou /really/ need to read the article "What Every Computer Scientist ShouldKnow About Floating-Point Arithmetic" originally published in the March, 1991issue of "Computing Surveys" (the journal of the ACM). It explains why younever get absolutely accurate results from a floatingpoint number. http://docs.sun.com/source/806-3568/ncg_goldberg.html--Lew PitcherMaster Codewright & JOAT-in-training | Registered Linux User #112576 http://pitcher.digitalfreehold.ca/ | GPG public key available by request---------- Slackware - Because I know what I''m doing. ------ 为什么?浮动大多是不合时宜的。完全没有理由使用它,Why? float is mostly an anachronism. There is very little reason touse it at all, 实际上,浮点数在某些领域比以往更受欢迎,其中 较小的精度和范围与双倍相比要么无关紧要,要么比空间和速度重要。它也被广泛用于 专用硬件,例如:图形处理器和SIMD CPU 扩展。Actually, float is more popular than ever in some domains, where itssmaller precision and range compared to double are either irrelevant orless important than space and speed. It''s also much more widely used inspecial-purpose hardware, e.g. graphics processors and the SIMD CPUextensions. 他们应该开始使用double,我同意,但是在某些时候他们应该学习权衡。更重要的是,他们应该被告知使用双倍的不能解决有限精度问题。 - Ernie http://home.comcast.net/~nniew 这篇关于浮动问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!