MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / gcd

Method gcd

code/mathematics/fraction.cpp:2–2  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1template <class T> struct fraction {
2 T gcd(T a, T b) { return b == T(0) ? a : gcd(b, a % b); }
3 T n, d;
4 fraction(T n_=T(0), T d_=T(1)) {
5 assert(d_ != 0);

Callers

nothing calls this directly

Calls 1

gcdFunction · 0.70

Tested by

no test coverage detected