MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / gcd2

Function gcd2

std/math/src/main/int.rs:18–21  ·  view source on GitHub ↗

Euclidean gcd on non-negative inputs.

(mut a: i128, mut b: i128)

Source from the content-addressed store, hash-verified

16
17// Euclidean gcd on non-negative inputs.
18fn gcd2(mut a: i128, mut b: i128) -> i128 {
19 while b != 0 { let t = b; b = a % b; a = t; }
20 a
21}
22
23#[plugin_fn]
24fn factorial(n: i128) -> Result<i128> {

Callers 2

gcdFunction · 0.85
lcmFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected