关于为什么某些C/C++环境下浮点数可以“正常”比较的问题
有师妹问浮点数比较的问题,然后有人展示了可以“正常”比较的例子,google了一堆东西如下,有空仔细读一读,整理整理
http://bytes.com/topic/c/answers/629184-peculiar-floating-point-numbers-gcc
http://stackoverflow.com/questions/3765200/gcc-handling-float-comparison-differently-at-different-optimization-levels
http://randomascii.wordpress.com/category/floating-point/
http://yosoygames.com.ar/wp/2013/07/on-floating-point-determinism/
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10417
http://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html
http://stackoverflow.com/questions/3915138/comparing-floating-point-0
http://stackoverflow.com/questions/7011184/floating-point-comparison
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html