MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / Recursive

Function Recursive

math/gcd/gcd.go:7–12  ·  view source on GitHub ↗

Recursive finds and returns the greatest common divisor of a given integer.

(a, b int64)

Source from the content-addressed store, hash-verified

5
6// Recursive finds and returns the greatest common divisor of a given integer.
7func Recursive(a, b int64) int64 {
8 if b == 0 {
9 return a
10 }
11 return Recursive(b, a%b)
12}

Callers 2

NewFunction · 0.92
testPreconditionFunction · 0.92

Calls

no outgoing calls

Tested by 1

testPreconditionFunction · 0.74