59 changes: 34 additions & 25 deletions doc/html/math_toolkit/history2.html
Expand Up @@ -34,7 +34,16 @@
</p>
<h5>
<a name="math_toolkit.history2.h0"></a>
<span class="phrase"><a name="math_toolkit.history2.math_1_9_1"></a></span><a class="link" href="history2.html#math_toolkit.history2.math_1_9_1">Math-1.9.1</a>
<span class="phrase"><a name="math_toolkit.history2.math_1_9_2"></a></span><a class="link" href="history2.html#math_toolkit.history2.math_1_9_2">Math-1.9.2</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fix <a class="link" href="rounding/round.html" title="Rounding Functions">round</a> and <a class="link" href="rounding/trunc.html" title="Truncation Functions">trunc</a> functions so they can
be used with integer arguments, see <a href="https://svn.boost.org/trac/boost/ticket/10066" target="_top">#10066</a>.
</li></ul></div>
<h5>
<a name="math_toolkit.history2.h1"></a>
<span class="phrase"><a name="math_toolkit.history2.math_1_9_1_boost_1_56_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.math_1_9_1_boost_1_56_0">Math-1.9.1
(Boost-1.56.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Expand All @@ -48,7 +57,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h1"></a>
<a name="math_toolkit.history2.h2"></a>
<span class="phrase"><a name="math_toolkit.history2.math_1_9_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.math_1_9_0">Math-1.9.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -115,7 +124,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h2"></a>
<a name="math_toolkit.history2.h3"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_55"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_55">Boost-1.55</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -171,7 +180,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h3"></a>
<a name="math_toolkit.history2.h4"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_54"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_54">Boost-1.54</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -225,7 +234,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h4"></a>
<a name="math_toolkit.history2.h5"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_53"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_53">Boost-1.53</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -260,7 +269,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h5"></a>
<a name="math_toolkit.history2.h6"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_52"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_52">Boost-1.52</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -307,14 +316,14 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h6"></a>
<a name="math_toolkit.history2.h7"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_51"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_51">Boost-1.51</a>
</h5>
<p>
See Boost-1.52 - some items were added but not listed in time for the release.
</p>
<h5>
<a name="math_toolkit.history2.h7"></a>
<a name="math_toolkit.history2.h8"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_50"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_50">Boost-1.50</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -351,7 +360,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h8"></a>
<a name="math_toolkit.history2.h9"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_49"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_49">Boost-1.49</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -395,7 +404,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h9"></a>
<a name="math_toolkit.history2.h10"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_48"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_48">Boost-1.48</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -446,7 +455,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h10"></a>
<a name="math_toolkit.history2.h11"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_47"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_47">Boost-1.47</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand All @@ -463,15 +472,15 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h11"></a>
<a name="math_toolkit.history2.h12"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_46_1"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_46_1">Boost-1.46.1</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed issues <a href="https://svn.boost.org/trac/boost/ticket/5095" target="_top">#5095</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5095" target="_top">#5113</a>.
</li></ul></div>
<h5>
<a name="math_toolkit.history2.h12"></a>
<a name="math_toolkit.history2.h13"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_46_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_46_0">Boost-1.46.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand All @@ -486,7 +495,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h13"></a>
<a name="math_toolkit.history2.h14"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_45_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_45_0">Boost-1.45.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand All @@ -503,7 +512,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h14"></a>
<a name="math_toolkit.history2.h15"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_44_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_44_0">Boost-1.44.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand All @@ -517,15 +526,15 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h15"></a>
<a name="math_toolkit.history2.h16"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_41_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_41_0">Boost-1.41.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Significantly improved performance for the incomplete gamma function and
its inverse.
</li></ul></div>
<h5>
<a name="math_toolkit.history2.h16"></a>
<a name="math_toolkit.history2.h17"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_40_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_40_0">Boost-1.40.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -561,7 +570,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h17"></a>
<a name="math_toolkit.history2.h18"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_38_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_38_0">Boost-1.38.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand All @@ -573,14 +582,14 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h18"></a>
<a name="math_toolkit.history2.h19"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_37_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_37_0">Boost-1.37.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Improved accuracy and testing of the inverse hypergeometric functions.
</li></ul></div>
<h5>
<a name="math_toolkit.history2.h19"></a>
<a name="math_toolkit.history2.h20"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_36_0"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_36_0">Boost-1.36.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
Expand Down Expand Up @@ -613,7 +622,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h20"></a>
<a name="math_toolkit.history2.h21"></a>
<span class="phrase"><a name="math_toolkit.history2.boost_1_35_0_post_review_first_o"></a></span><a class="link" href="history2.html#math_toolkit.history2.boost_1_35_0_post_review_first_o">Boost-1.35.0:
Post Review First Official Release</a>
</h5>
Expand Down Expand Up @@ -645,7 +654,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h21"></a>
<a name="math_toolkit.history2.h22"></a>
<span class="phrase"><a name="math_toolkit.history2.milestone_4_second_review_candid"></a></span><a class="link" href="history2.html#math_toolkit.history2.milestone_4_second_review_candid">Milestone
4: Second Review Candidate (1st March 2007)</a>
</h5>
Expand All @@ -659,7 +668,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h22"></a>
<a name="math_toolkit.history2.h23"></a>
<span class="phrase"><a name="math_toolkit.history2.milestone_3_first_review_candida"></a></span><a class="link" href="history2.html#math_toolkit.history2.milestone_3_first_review_candida">Milestone
3: First Review Candidate (31st Dec 2006)</a>
</h5>
Expand Down Expand Up @@ -687,7 +696,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h23"></a>
<a name="math_toolkit.history2.h24"></a>
<span class="phrase"><a name="math_toolkit.history2.milestone_2_released_september_1"></a></span><a class="link" href="history2.html#math_toolkit.history2.milestone_2_released_september_1">Milestone
2: Released September 10th 2006</a>
</h5>
Expand Down Expand Up @@ -723,7 +732,7 @@ <h5>
</li>
</ul></div>
<h5>
<a name="math_toolkit.history2.h24"></a>
<a name="math_toolkit.history2.h25"></a>
<span class="phrase"><a name="math_toolkit.history2.milestone_1_released_march_31st_"></a></span><a class="link" href="history2.html#math_toolkit.history2.milestone_1_released_march_31st_">Milestone
1: Released March 31st 2006</a>
</h5>
Expand Down
2 changes: 1 addition & 1 deletion doc/html/math_toolkit/navigation.html
Expand Up @@ -27,7 +27,7 @@
<a name="math_toolkit.navigation"></a><a class="link" href="navigation.html" title="Navigation">Navigation</a>
</h2></div></div></div>
<p>
<a class="indexterm" name="idm1568417984"></a>
<a class="indexterm" name="idm1567978768"></a>
</p>
<p>
Boost.Math documentation is provided in both HTML and PDF formats.
Expand Down
6 changes: 5 additions & 1 deletion doc/overview/roadmap.qbk
Expand Up @@ -6,7 +6,11 @@ Currently open bug reports can be viewed
All bug reports including closed ones can be viewed
[@https://svn.boost.org/trac/boost/query?status=assigned&status=closed&status=new&status=reopened&component=math&col=id&col=summary&col=status&col=type&col=milestone&col=component&order=priority here].

[h4 Math-1.9.1]
[h4 Math-1.9.2]

* Fix __round and __trunc functions so they can be used with integer arguments, see [@https://svn.boost.org/trac/boost/ticket/10066 #10066].

[h4 Math-1.9.1 (Boost-1.56.0)]

* Fix Geometric distribution use of Policies, see [@https://svn.boost.org/trac/boost/ticket/9833 #9833].
* Fix corner cases in the negative binomial distribution, see [@https://svn.boost.org/trac/boost/ticket/9834 #9834].
Expand Down
19 changes: 17 additions & 2 deletions include/boost/math/special_functions/round.hpp
Expand Up @@ -17,15 +17,30 @@

namespace boost{ namespace math{

namespace detail{

template <class T, class Policy>
inline typename tools::promote_args<T>::type round(const T& v, const Policy& pol)
inline typename tools::promote_args<T>::type round(const T& v, const Policy& pol, const mpl::false_)
{
BOOST_MATH_STD_USING
typedef typename tools::promote_args<T>::type result_type;
typedef typename tools::promote_args<T>::type result_type;
if(!(boost::math::isfinite)(v))
return policies::raise_rounding_error("boost::math::round<%1%>(%1%)", 0, static_cast<result_type>(v), static_cast<result_type>(v), pol);
return v < 0 ? static_cast<result_type>(ceil(v - 0.5f)) : static_cast<result_type>(floor(v + 0.5f));
}
template <class T, class Policy>
inline typename tools::promote_args<T>::type round(const T& v, const Policy&, const mpl::true_)
{
return v;
}

} // namespace detail

template <class T, class Policy>
inline typename tools::promote_args<T>::type round(const T& v, const Policy& pol)
{
return detail::round(v, pol, mpl::bool_<detail::is_integer_for_rounding<T>::value>());
}
template <class T>
inline typename tools::promote_args<T>::type round(const T& v)
{
Expand Down
18 changes: 16 additions & 2 deletions include/boost/math/special_functions/trunc.hpp
Expand Up @@ -15,17 +15,31 @@
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/special_functions/fpclassify.hpp>

namespace boost{ namespace math{
namespace boost{ namespace math{ namespace detail{

template <class T, class Policy>
inline typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol)
inline typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol, const mpl::false_&)
{
BOOST_MATH_STD_USING
typedef typename tools::promote_args<T>::type result_type;
if(!(boost::math::isfinite)(v))
return policies::raise_rounding_error("boost::math::trunc<%1%>(%1%)", 0, static_cast<result_type>(v), static_cast<result_type>(v), pol);
return (v >= 0) ? static_cast<result_type>(floor(v)) : static_cast<result_type>(ceil(v));
}

template <class T, class Policy>
inline typename tools::promote_args<T>::type trunc(const T& v, const Policy&, const mpl::true_&)
{
return v;
}

}

template <class T, class Policy>
inline typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol)
{
return detail::trunc(v, pol, mpl::bool_<detail::is_integer_for_rounding<T>::value>());
}
template <class T>
inline typename tools::promote_args<T>::type trunc(const T& v)
{
Expand Down
14 changes: 14 additions & 0 deletions include/boost/math/tools/config.hpp
Expand Up @@ -298,6 +298,20 @@ void suppress_unused_variable_warning(const T&)
{
}

namespace detail{

template <class T>
struct is_integer_for_rounding
{
static const bool value = boost::is_integral<T>::value
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|| (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer)
#endif
;
};

}

}} // namespace boost namespace math

#ifdef __GLIBC_PREREQ
Expand Down