关于浮点数的比较

由于浮点数在计算机中无法精确表示的原因,比较浮点数不能简单的使用 == 号。之前一直没有注意到这个问题,具体的解释及解决方案参考下列文章。


 

  1. https://www.cnblogs.com/lakeone/p/4984862.html
  2. http://www.cnblogs.com/zourrou/archive/2011/05/08/2040712.html
  3. https://www.cnblogs.com/liuyc/p/5933850.html

猜你喜欢

转载自www.cnblogs.com/mycyberspace/p/9335196.html