mirror of
https://github.com/boostorg/integer.git
synced 2025-07-29 20:27:14 +02:00
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]
This commit is contained in:
committed by
Peter Dimov
parent
7c528c325e
commit
5174291e08
@ -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<IntegerType>( 0 );
|
||||
IntegerType const result = gcd_euclidean( a, b );
|
||||
|
||||
return ( result < zero ) ? -result : result;
|
||||
return ( result < zero ) ? static_cast<IntegerType>(-result) : result;
|
||||
}
|
||||
|
||||
// Greatest common divisor for unsigned binary integers
|
||||
@ -212,7 +212,7 @@ namespace detail
|
||||
IntegerType const zero = static_cast<IntegerType>( 0 );
|
||||
IntegerType const result = lcm_euclidean( a, b );
|
||||
|
||||
return ( result < zero ) ? -result : result;
|
||||
return ( result < zero ) ? static_cast<IntegerType>(-result) : result;
|
||||
}
|
||||
|
||||
// Function objects to find the best way of computing GCD or LCM
|
||||
|
Reference in New Issue
Block a user