https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64677

--- Comment #10 from Mikhail Maltsev <maltsevm at gmail dot com> ---
> 1. Why does the answer change based on the -std?
I could reproduce the same result on GCC 4.8.2. I suppose that the most
significant difference is that C++11 supports constexpr (and std::complex has
constexpr constructor).
Also, at higher optimization level, e.g. -O3, C++98 version will also get
folded (it just requires more inlining than C++11).
> Is Wolfram Alpha considered the authoritative answer?
It's unlikely that it will give incorrect answer, but of course is cannot be
considered a reference implementation, like, for example the C++ standard. By
the way, according to C++ standard, precision of floating point numbers is
implementation-defined.

Reply via email to