PandA-2024.02
examples
cpp_examples
gcd_example
gcd.cc
Go to the documentation of this file.
1
#include <algorithm>
2
int
gcd
(
int
x
,
int
y )
3
{
4
if
( x < y )
5
std::swap( x, y );
6
7
while
( y > 0 )
8
{
9
int
f = x % y;
10
x = y;
11
y = f;
12
}
13
return
x
;
14
}
15
16
gcd
int gcd(int x, int y)
Definition:
gcd.cc:2
x
x
Return the smallest n such that 2^n >= _x.
Definition:
math_function.hpp:170
Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by
1.8.13