From 88d6840a19455fe0e6ecd18fb8be48e4de2cf420 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 2 Dec 2025 12:39:36 +0100 Subject: [PATCH] Cast arguments prior to taking abs --- include/boost/random/binomial_distribution.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/random/binomial_distribution.hpp b/include/boost/random/binomial_distribution.hpp index 78d1a12..a98d53b 100644 --- a/include/boost/random/binomial_distribution.hpp +++ b/include/boost/random/binomial_distribution.hpp @@ -321,7 +321,7 @@ private: IntType k = static_cast(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(k) - static_cast(m)); if(km <= 15) { RealType f = 1; if(m < k) {