Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ jobs:

- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-13
os: macos-14
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
os: macos-15

timeout-minutes: 360
runs-on: ${{matrix.os}}
Expand Down Expand Up @@ -517,7 +517,6 @@ jobs:
matrix:
include:
- os: ubuntu-24.04
- os: macos-13
- os: macos-14
- os: macos-15

Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ target_link_libraries(boost_random
Boost::dynamic_bitset
Boost::integer
Boost::io
Boost::static_assert
Boost::system
Boost::throw_exception
Boost::type_traits
Expand Down
1 change: 0 additions & 1 deletion build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ constant boost_dependencies :
/boost/dynamic_bitset//boost_dynamic_bitset
/boost/integer//boost_integer
/boost/io//boost_io
/boost/static_assert//boost_static_assert
/boost/system//boost_system
/boost/throw_exception//boost_throw_exception
/boost/type_traits//boost_type_traits
Expand Down
2 changes: 1 addition & 1 deletion include/boost/random/binomial_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ class binomial_distribution {
IntType k = static_cast<IntType>(floor((2*_u.btrd.a/us + _u.btrd.b)*u + _u.btrd.c));
if(k < 0 || k > _t) continue;
v = v*_u.btrd.alpha/(_u.btrd.a/(us*us) + _u.btrd.b);
RealType km = abs(k - m);
RealType km = abs(static_cast<RealType>(k) - static_cast<RealType>(m));
if(km <= 15) {
RealType f = 1;
if(m < k) {
Expand Down
2 changes: 1 addition & 1 deletion include/boost/random/uniform_int_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ T generate_uniform_int(
if(mult * range_type(brange) == range - mult + 1) {
// The destination range is an integer power of
// the generator's range.
return(result);
return static_cast<result_type>(result);
}

// Postcondition: mult <= range
Expand Down
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ if(HAVE_BOOST_TEST)
Boost::multiprecision
Boost::numeric_conversion
Boost::range
Boost::static_assert
Boost::system
Boost::throw_exception
Boost::type_traits
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ run test_comp_xoshiro128f.cpp ;

run github_issue_133.cpp ;
run github_issue_147.cpp ;
run github_issue_150.cpp ;

run niederreiter_base2_validate.cpp /boost/test//boost_unit_test_framework ;
run sobol_validate.cpp /boost/test//boost_unit_test_framework ;
Expand Down
25 changes: 25 additions & 0 deletions test/github_issue_150.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright Matt Borland 2025.
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id$
*/

#include <boost/random.hpp>
#include <boost/core/lightweight_test.hpp>
#include <random>
#include <cstdint>

int main()
{
std::mt19937_64 gen;
boost::random::binomial_distribution<std::uint64_t> dist;

BOOST_TEST(dist(gen) >= 0);

return boost::report_errors();
}