From 5174291e08214d1d07ce8e46aaa85c85713047c9 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 7 May 2010 15:36:09 +0000 Subject: [PATCH] Fix failures when used with an expression-template enabled number type such as the gmpxx clases. Add additional concept check for integer code using gmp classes. Fixes #4139. [SVN r61837] --- include/boost/math/common_factor_rt.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/math/common_factor_rt.hpp b/include/boost/math/common_factor_rt.hpp index f45f3a0..ef2a967 100644 --- a/include/boost/math/common_factor_rt.hpp +++ b/include/boost/math/common_factor_rt.hpp @@ -78,8 +78,8 @@ namespace detail RingType gcd_euclidean ( - RingType a, - RingType b + RingType a, + RingType b ) { // Avoid repeated construction @@ -116,7 +116,7 @@ namespace detail IntegerType const zero = static_cast( 0 ); IntegerType const result = gcd_euclidean( a, b ); - return ( result < zero ) ? -result : result; + return ( result < zero ) ? static_cast(-result) : result; } // Greatest common divisor for unsigned binary integers @@ -212,7 +212,7 @@ namespace detail IntegerType const zero = static_cast( 0 ); IntegerType const result = lcm_euclidean( a, b ); - return ( result < zero ) ? -result : result; + return ( result < zero ) ? static_cast(-result) : result; } // Function objects to find the best way of computing GCD or LCM