Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

static int gcd ( int  x,
int  y 
) [static]

Get maximum common divisor.

Parameters:
x First input value
y Second input value
Returns:
Maximum common divisor of x and y

Definition at line 93 of file mx27_prphw.c.

Referenced by ratio().

{
      int k;

      if (x < y) {
            k = x;
            x = y;
            y = k;
      }

      while ((k = x % y)) {
            x = y;
            y = k;
      }

      return y;
}


Generated by  Doxygen 1.6.0   Back to index