Commit 9fb29828 by Paolo Carlini Committed by Paolo Carlini

cmath (atan2, [...]): Simplify constraining on the return type.

2011-11-13  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/c_global/cmath (atan2, fmod, pow, copysign, fdim,
	fma, fmax, fmin, hypot, nextafter, remainder, remquo): Simplify
	constraining on the return type.
	* include/tr1/cmath (copysign, fdim, fma, fmax, fmin, hypot,
	nextafter, remainder, remquo): Likewise.

From-SVN: r181341
parent f36348b3
2011-11-13 Paolo Carlini <paolo.carlini@oracle.com>
* include/c_global/cmath (atan2, fmod, pow, copysign, fdim,
fma, fmax, fmin, hypot, nextafter, remainder, remquo): Simplify
constraining on the return type.
* include/tr1/cmath (copysign, fdim, fma, fmax, fmin, hypot,
nextafter, remainder, remquo): Likewise.
2011-11-13 Gerald Pfeifer <gerald@pfeifer.com> 2011-11-13 Gerald Pfeifer <gerald@pfeifer.com>
* using.xml: Use GNU/Linux. * using.xml: Use GNU/Linux.
......
...@@ -173,10 +173,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -173,10 +173,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline _GLIBCXX_CONSTEXPR inline _GLIBCXX_CONSTEXPR
typename __gnu_cxx::__promote_2< typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
atan2(_Tp __y, _Up __x) atan2(_Tp __y, _Up __x)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -311,10 +308,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -311,10 +308,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline _GLIBCXX_CONSTEXPR inline _GLIBCXX_CONSTEXPR
typename __gnu_cxx::__promote_2< typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmod(_Tp __x, _Up __y) fmod(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -439,10 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -439,10 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline _GLIBCXX_CONSTEXPR inline _GLIBCXX_CONSTEXPR
typename __gnu_cxx::__promote_2< typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
pow(_Tp __x, _Up __y) pow(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1256,11 +1247,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1256,11 +1247,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_copysignl(__x, __y); } { return __builtin_copysignl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
copysign(_Tp __x, _Up __y) copysign(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1332,11 +1319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1332,11 +1319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fdiml(__x, __y); } { return __builtin_fdiml(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fdim(_Tp __x, _Up __y) fdim(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1352,12 +1335,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1352,12 +1335,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmal(__x, __y, __z); } { return __builtin_fmal(__x, __y, __z); }
template<typename _Tp, typename _Up, typename _Vp> template<typename _Tp, typename _Up, typename _Vp>
constexpr constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
typename __gnu_cxx::__promote_3<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value
&& __is_arithmetic<_Vp>::__value,
_Tp>::__type, _Up, _Vp>::__type
fma(_Tp __x, _Up __y, _Vp __z) fma(_Tp __x, _Up __y, _Vp __z)
{ {
typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
...@@ -1373,11 +1351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1373,11 +1351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmaxl(__x, __y); } { return __builtin_fmaxl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmax(_Tp __x, _Up __y) fmax(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1393,11 +1367,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1393,11 +1367,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fminl(__x, __y); } { return __builtin_fminl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmin(_Tp __x, _Up __y) fmin(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1413,12 +1383,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1413,12 +1383,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_hypotl(__x, __y); } { return __builtin_hypotl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2< hypot(_Tp __x, _Up __y)
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
hypot(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
return hypot(__type(__x), __type(__y)); return hypot(__type(__x), __type(__y));
...@@ -1575,11 +1541,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1575,11 +1541,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nextafterl(__x, __y); } { return __builtin_nextafterl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
nextafter(_Tp __x, _Up __y) nextafter(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1609,11 +1571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1609,11 +1571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remainderl(__x, __y); } { return __builtin_remainderl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remainder(_Tp __x, _Up __y) remainder(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -1629,11 +1587,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -1629,11 +1587,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remquol(__x, __y, __pquo); } { return __builtin_remquol(__x, __y, __pquo); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
constexpr constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remquo(_Tp __x, _Up __y, int* __pquo) remquo(_Tp __x, _Up __y, int* __pquo)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
......
...@@ -492,11 +492,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -492,11 +492,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_copysignl(__x, __y); } { return __builtin_copysignl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
copysign(_Tp __x, _Up __y) copysign(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -597,11 +593,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -597,11 +593,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fdiml(__x, __y); } { return __builtin_fdiml(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fdim(_Tp __x, _Up __y) fdim(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -619,12 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -619,12 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmal(__x, __y, __z); } { return __builtin_fmal(__x, __y, __z); }
template<typename _Tp, typename _Up, typename _Vp> template<typename _Tp, typename _Up, typename _Vp>
inline inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
typename __gnu_cxx::__promote_3<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value
&& __is_arithmetic<_Vp>::__value,
_Tp>::__type, _Up, _Vp>::__type
fma(_Tp __x, _Up __y, _Vp __z) fma(_Tp __x, _Up __y, _Vp __z)
{ {
typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
...@@ -640,11 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -640,11 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fmaxl(__x, __y); } { return __builtin_fmaxl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmax(_Tp __x, _Up __y) fmax(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -660,11 +643,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -660,11 +643,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_fminl(__x, __y); } { return __builtin_fminl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
fmin(_Tp __x, _Up __y) fmin(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -683,11 +662,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -683,11 +662,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_hypotl(__x, __y); } { return __builtin_hypotl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
hypot(_Tp __y, _Up __x) hypot(_Tp __y, _Up __x)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -851,11 +826,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -851,11 +826,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_nextafterl(__x, __y); } { return __builtin_nextafterl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
nextafter(_Tp __x, _Up __y) nextafter(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -889,11 +860,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -889,11 +860,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remainderl(__x, __y); } { return __builtin_remainderl(__x, __y); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remainder(_Tp __x, _Up __y) remainder(_Tp __x, _Up __y)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
...@@ -909,11 +876,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -909,11 +876,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_remquol(__x, __y, __pquo); } { return __builtin_remquol(__x, __y, __pquo); }
template<typename _Tp, typename _Up> template<typename _Tp, typename _Up>
inline inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
typename __gnu_cxx::__promote_2<
typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value
&& __is_arithmetic<_Up>::__value,
_Tp>::__type, _Up>::__type
remquo(_Tp __x, _Up __y, int* __pquo) remquo(_Tp __x, _Up __y, int* __pquo)
{ {
typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment