This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libgcc/64677] incorrect result with complex division?
- From: "spatel at rotateright dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Jan 2015 20:04:39 +0000
- Subject: [Bug libgcc/64677] incorrect result with complex division?
- Auto-submitted: auto-generated
- References: <bug-64677-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64677
--- Comment #9 from Sanjay Patel <spatel at rotateright dot com> ---
(In reply to Sanjay Patel from comment #8)
> It seems I don't need the -std=c++11 flag as I do on OS X?
Actually, I screwed that up. We don't need that flag on OS X either...and
thankfully, the behavior matches Linux. This is on the same OS X (10.10) that I
was testing on when filing the bug:
$ g++ -O0 complex_div.cpp ; ./a.out
-0.0083223357032193145
$ g++ -O1 complex_div.cpp ; ./a.out
-0.0083223357032193145
$ g++ -O0 complex_div.cpp -std=c++11 ; ./a.out
-0.0083223357032193145
$ g++ -O1 complex_div.cpp -std=c++11 ; ./a.out
-0.0083223357032193128
So there are (at least) 2 questions:
1. Why does the answer change based on the -std?
2. What is the correct answer?