MCPcopy Index your code
hub / github.com/RustPython/RustPython / gcd

Function gcd

crates/stdlib/src/math.rs:779–787  ·  view source on GitHub ↗
(args: PosArgs<ArgIndex>)

Source from the content-addressed store, hash-verified

777
778 #[pyfunction]
779 fn gcd(args: PosArgs<ArgIndex>) -> BigInt {
780 let ints: Vec<_> = args
781 .into_vec()
782 .into_iter()
783 .map(|x| x.into_int_ref())
784 .collect();
785 let refs: Vec<_> = ints.iter().map(|x| x.as_bigint()).collect();
786 pymath::math::integer::gcd(&refs)
787 }
788
789 #[pyfunction]
790 fn lcm(args: PosArgs<ArgIndex>) -> BigInt {

Callers

nothing calls this directly

Calls 7

collectMethod · 0.80
into_int_refMethod · 0.80
as_bigintMethod · 0.80
mapMethod · 0.45
into_iterMethod · 0.45
into_vecMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected