mirror of
https://github.com/boostorg/integer.git
synced 2025-07-30 04:37:13 +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
|
RingType
|
||||||
gcd_euclidean
|
gcd_euclidean
|
||||||
(
|
(
|
||||||
RingType a,
|
RingType a,
|
||||||
RingType b
|
RingType b
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Avoid repeated construction
|
// Avoid repeated construction
|
||||||
@ -116,7 +116,7 @@ namespace detail
|
|||||||
IntegerType const zero = static_cast<IntegerType>( 0 );
|
IntegerType const zero = static_cast<IntegerType>( 0 );
|
||||||
IntegerType const result = gcd_euclidean( a, b );
|
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
|
// Greatest common divisor for unsigned binary integers
|
||||||
@ -212,7 +212,7 @@ namespace detail
|
|||||||
IntegerType const zero = static_cast<IntegerType>( 0 );
|
IntegerType const zero = static_cast<IntegerType>( 0 );
|
||||||
IntegerType const result = lcm_euclidean( a, b );
|
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
|
// Function objects to find the best way of computing GCD or LCM
|
||||||
|
Reference in New Issue
Block a user