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

Function lcm

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

Source from the content-addressed store, hash-verified

788
789 #[pyfunction]
790 fn lcm(args: PosArgs<ArgIndex>) -> BigInt {
791 let ints: Vec<_> = args
792 .into_vec()
793 .into_iter()
794 .map(|x| x.into_int_ref())
795 .collect();
796 let refs: Vec<_> = ints.iter().map(|x| x.as_bigint()).collect();
797 pymath::math::integer::lcm(&refs)
798 }
799
800 #[pyfunction]
801 fn factorial(x: PyIntRef, vm: &VirtualMachine) -> PyResult<BigInt> {

Callers 1

test_lcmMethod · 0.85

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 1

test_lcmMethod · 0.68