MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Iterative

Function Iterative

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

Iterative Faster iterative version of GcdRecursive without holding up too much of the stack

(a, b int64)

Source from the content-addressed store, hash-verified

5
6// Iterative Faster iterative version of GcdRecursive without holding up too much of the stack
7func Iterative(a, b int64) int64 {
8 for b != 0 {
9 a, b = b, a%b
10 }
11 return a
12}

Callers 1

LcmFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected