diff --git a/include/boost/math/common_factor_rt.hpp b/include/boost/math/common_factor_rt.hpp index c02d12a..6200b96 100644 --- a/include/boost/math/common_factor_rt.hpp +++ b/include/boost/math/common_factor_rt.hpp @@ -15,6 +15,7 @@ #include // for BOOST_NESTED_TEMPLATE, etc. #include // for std::numeric_limits +#include namespace boost @@ -142,11 +143,18 @@ namespace detail // Whittle down the values via their differences do { +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) + while ( !(r[ which ] & 1u) ) + { + r[ which ] = (r[which] >> 1); + } +#else // Remove factors of two from the even one while ( !(r[ which ] & 1u) ) { r[ which ] >>= 1; } +#endif // Replace the larger of the two with their difference if ( r[!which] > r[which] )