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

Function isqrt

crates/stdlib/src/math.rs:772–776  ·  view source on GitHub ↗
(x: ArgIndex, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

770
771 #[pyfunction]
772 fn isqrt(x: ArgIndex, vm: &VirtualMachine) -> PyResult<BigInt> {
773 let value = x.into_int_ref();
774 pymath::math::integer::isqrt(value.as_bigint())
775 .map_err(|_| vm.new_value_error("isqrt() argument must be nonnegative"))
776 }
777
778 #[pyfunction]
779 fn gcd(args: PosArgs<ArgIndex>) -> BigInt {

Callers

nothing calls this directly

Calls 2

into_int_refMethod · 0.80
as_bigintMethod · 0.80

Tested by

no test coverage detected