This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64677] incorrect result with complex division?
- From: "maltsevm at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 20 Jan 2015 04:48:05 +0000
- Subject: [Bug c++/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
Mikhail Maltsev <maltsevm at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |maltsevm at gmail dot com
--- Comment #3 from Mikhail Maltsev <maltsevm at gmail dot com> ---
Probably calculating with higher precision will give correct result. Output of
Wolfram Alpha:
-O0:
convert -0.0083223357032193145 to binary
-1.00010000101101001100111111010101111110001111010101101111110000100111001001000000101110010001111111000010000110010110110001111..._2Ã2^-7
| hexadecimal value
IEEE double-precision number | 578f5ffd4c0b81bf
(assuming little-endian byte ordering)
-O1:
convert -0.0083223357032193128 to binary
-1.00010000101101001100111111010101111110001111010101100000000101000110111101001110010111111111111111010110100111010111010010011..._2Ã2^-7
| hexadecimal value
IEEE double-precision number | 568f5ffd4c0b81bf
(assuming little-endian byte ordering)
Wolfram Alpha's calculation:
binary(re(1/(-61.887073591767951 -60.052083270252012i)))
-1.0001000010110100110011111101010111111000111101010110000111101100101010111110001101011011011011010000000101100000101111101111..._2Ã2^-7
| hexadecimal value
IEEE double-precision number | 568f5ffd4c0b81bf
(assuming little-endian byte ordering)
So, compile-time result is more precise. BTW, what does the disassembly look
like?