mirror of
https://github.com/boostorg/integer.git
synced 2025-07-29 20:27:14 +02:00
Fix Borland infinite looping issue.
[SVN r39723]
This commit is contained in:
committed by
Peter Dimov
parent
a9d91361fa
commit
307fee457a
@ -15,6 +15,7 @@
|
||||
|
||||
#include <boost/config.hpp> // for BOOST_NESTED_TEMPLATE, etc.
|
||||
#include <boost/limits.hpp> // for std::numeric_limits
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
|
||||
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] )
|
||||
|
Reference in New Issue
Block a user