2003-03-21 Jerry Quinn <jlquinn@optonline.net>
PR libstdc++/5730
* include/bits/c++config (_GLIBCPP_FAST_MATH): Define.
* include/std/std_complex.h (norm): Use faster,
less accurate computation for builtin float types under --fast-math.
From-SVN: r64701
+2003-03-21 Jerry Quinn <jlquinn@optonline.net>
+
+ PR libstdc++/5730
+ * include/bits/c++config (_GLIBCPP_FAST_MATH): Define.
+ * include/std/std_complex.h (norm): Use faster,
+ less accurate computation for builtin float types under --fast-math.
+
2003-03-21 Magnus Fromreide <gnats@magfr.user.lysator.liu.se>
* testsuite/testsuite_hooks.h: Fix warning nits.
#error __USE_MALLOC should never be defined. Read the release notes.
#endif
+// Create a boolean flag to be used to determine if --fast-math is set.
+#ifdef __FAST_MATH__
+#define _GLIBCPP_FAST_MATH 1
+#else
+#define _GLIBCPP_FAST_MATH 0
+#endif
+
// The remainder of the prewritten config is mostly automatic; all the
// user hooks are listed above.
inline _Tp
norm(const complex<_Tp>& __z)
{
- return _Norm_helper<__is_floating<_Tp>::_M_type>::_S_do_it(__z);
+ return _Norm_helper<__is_floating<_Tp>::_M_type && !_GLIBCPP_FAST_MATH>::_S_do_it(__z);
}
template<typename _Tp>