On Fri, 15 Feb 2008 20:05:06 +0800, mojianhao wrote: > Hi experts, I have a small test case, it got different result when > compile with -O0 option and -O2 option. Is this a bug of gcc > ?
[...] Wow, that took some reformatting! What newsreader are you using? Anyhow, no it's almost certainly not a bug. Read up on why floating point comparisons can give unexpected results. Here's a good place to start: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.17 If you can get your head round that and want to dig a little deeper, try: http://docs.sun.com/source/806-3568/ncg_goldberg.html Regards, -- Lionel B _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus