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

Function lean_py_to_float

LeanPy/native/python_bridge.c:581–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

579 if (r < 0) return raise_py_error();
580 return lean_io_result_mk_ok(lean_box(r ? 1 : 0));
581}
582
583LEAN_EXPORT lean_obj_res lean_py_to_int64(b_lean_obj_arg p, lean_obj_arg world) {
584 (void)world; ENSURE_INIT(); WITH_GIL();
585 long long v = p_PyLong_AsLongLong(unwrap_pyobject(p));
586 if (v == -1 && p_PyErr_Occurred()) return raise_py_error();
587 return lean_io_result_mk_ok(lean_int64_to_int((int64_t) v));
588}
589

Callers

nothing calls this directly

Calls 3

unwrap_pyobjectFunction · 0.85
raise_py_errorFunction · 0.85
lean_box_floatFunction · 0.85

Tested by

no test coverage detected