basix_doc 0.1
unsigned_int_gcd_helper Struct Reference

#include <int.hpp>

List of all members.

Static Public Member Functions


Detailed Description

Definition at line 527 of file int.hpp.


Member Function Documentation

static I gcd ( const I &  a,
const I &  b 
) [inline, static]

Definition at line 529 of file int.hpp.

References mmx::I().

                                        {
    I r0=a, r1=b, q, t; 
    if ((r0 == 0) && (r1 != 0)) {
      q = (r0-r1) / r1 + 1;
      t = r0 - q * r1;
      r0 = r1;
      r1 = t;
    }
    while (r1 != 0) {
      q = r0 / r1;
      t = r0 - q * r1;
      r0 = r1;
      r1 = t;
    }
    return r0;
  }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines