MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / lean_uint64_of_nat

Function lean_uint64_of_nat

lean_py/_runtime.py:639–648  ·  view source on GitHub ↗
(self, p)

Source from the content-addressed store, hash-verified

637 raise RuntimeError(f"Cannot convert uint64 {n} to Nat: lean_big_uint64_to_nat not found")
638
639 def lean_uint64_of_nat(self, p):
640 # Inline: small scalar fast-path; large path via lean_uint64_of_big_nat.
641 if self.lean_is_scalar(p):
642 return int(self.lean_unbox(p))
643 fn = getattr(self.lib, "lean_uint64_of_big_nat", None)
644 if fn is None:
645 raise RuntimeError("lean_uint64_of_big_nat not found and Nat is not scalar")
646 fn.argtypes = [LeanObjectPtr]
647 fn.restype = c_uint64
648 return int(fn(p))
649
650 def lean_int64_to_int(self, n):
651 # Prefer the C-side helper from leanpy_native, which delegates

Callers 1

leanpy_uint64_of_natFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected