~ubuntu-branches/ubuntu/wily/ruby-passenger/wily-proposed

« back to all changes in this revision

Viewing changes to ext/boost/math/special_functions/sign.hpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-11-23 23:50:02 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131123235002-8fdhsq7afj15o2z2
Tags: 4.0.25-1
* New upstream release.
* Refresh fix_install_path.patch.
* Build for Ruby 2.0 instead of 1.8. (Closes: #725591)
* Add fix_ftbfs_fortify_source.patch.
* Install passenger template files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
111
111
   typedef typename detail::fp_traits<T>::type traits;
112
112
   typedef typename traits::method method;
113
 
   typedef typename boost::is_floating_point<T>::type fp_tag;
114
 
   return detail::signbit_impl(x, method());
 
113
   // typedef typename boost::is_floating_point<T>::type fp_tag;
 
114
   typedef typename tools::promote_args<T>::type result_type;
 
115
   return detail::signbit_impl(static_cast<result_type>(x), method());
115
116
}
116
117
 
117
118
template <class T>
120
121
   return (z == 0) ? 0 : (boost::math::signbit)(z) ? -1 : 1;
121
122
}
122
123
 
123
 
template<class T> T (changesign)(const T& x)
 
124
template <class T> typename tools::promote_args<T>::type (changesign)(const T& x)
124
125
{ //!< \brief return unchanged binary pattern of x, except for change of sign bit. 
125
126
   typedef typename detail::fp_traits<T>::sign_change_type traits;
126
127
   typedef typename traits::method method;
127
 
   typedef typename boost::is_floating_point<T>::type fp_tag;
 
128
   // typedef typename boost::is_floating_point<T>::type fp_tag;
 
129
   typedef typename tools::promote_args<T>::type result_type;
128
130
 
129
 
   return detail::changesign_impl(x, method());
 
131
   return detail::changesign_impl(static_cast<result_type>(x), method());
130
132
}
131
133
 
132
 
template <class T>
133
 
inline T copysign BOOST_NO_MACRO_EXPAND(const T& x, const T& y)
 
134
template <class T, class U>
 
135
inline typename tools::promote_args<T, U>::type 
 
136
   copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y)
134
137
{
135
138
   BOOST_MATH_STD_USING
136
 
   return (boost::math::signbit)(x) != (boost::math::signbit)(y) ? (boost::math::changesign)(x) : x;
 
139
   typedef typename tools::promote_args<T, U>::type result_type;
 
140
   return (boost::math::signbit)(static_cast<result_type>(x)) != (boost::math::signbit)(static_cast<result_type>(y)) 
 
141
      ? (boost::math::changesign)(static_cast<result_type>(x)) : static_cast<result_type>(x);
137
142
}
138
143
 
139
144
} // namespace math