unsigned_int_floor_sqrt_helper< I > Struct Template Reference
#include <int.hpp>
List of all members.
Static Public Member Functions
Detailed Description
template<typename I>
 struct mmx::unsigned_int_floor_sqrt_helper< I >
Definition at line 484 of file int.hpp.
Member Function Documentation
      
        
          | static I floor_sqrt | ( | const I & | x | ) |  [inline, static] | 
      
 
Definition at line 485 of file int.hpp.
References mmx::I().
00485                                    {
00486     I y= x, r= 0, b= ((I) 1) << (8 * sizeof (I) - 2);
00487     while (b > y) b >>= 2;
00488     while (b != 0) {
00489         if (y >= r + b) { y -= r + b; r = (r >> 1) + b; }
00490         else r >>= 1;
00491         b >>= 2;
00492     }
00493     return r; }
 
 
The documentation for this struct was generated from the following file: