[Bug libstdc++/54757] FAIL: ext/random/beta_distribution/cons/default.cc (test for excess errors)

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Sat Sep 29 23:34:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54757

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-09-29 23:34:20 UTC ---
I suppose _GLIBCXX_USE_C99_MATH_TR1 remains undefined on hppa-hpux, right?

In that case, I would pre-approve a patch changing each of the three uses of
the C99 hypot in include/ext/random and include/ext/random.tcc with
std::sqrt(x*x + y*y) as a fall back, like:

#if _GLIBCXX_USE_C99_MATH_TR1
        *__f++ = std::hypot(__x, __y);
#else
        *__f++ = std::sqrt(__x * __x + __y * __y);
#endif

etc. Maybe also add a comment explaining that in the future we may want to do
better (in terms of overflow, etc). Note however, that this is *already* the
case for many old <random> facilities: if the macro in undefined the
implementation is way worse.



More information about the Gcc-bugs mailing list