diff options
| author | Yoctopuce dev <dev@yoctopuce.com> | 2025-06-30 23:28:20 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-07-09 11:54:21 +1000 |
| commit | c4a88f2ce7da87d5f635ec25edba481917020fd8 (patch) | |
| tree | 6d8c704092f58c09136d5bd41563a7c73c57e6f4 /py/obj.h | |
| parent | 49159ef6b7e283681cb1c2dfe44cdf14bd397467 (diff) | |
py/obj: Add functions to retrieve large integers from mp_obj_t.
This commit provides helpers to retrieve integer values from
mp_obj_t when the content does not fit in a 32 bits integer,
without risking an implicit wrap due to an int overflow.
Signed-off-by: Yoctopuce dev <dev@yoctopuce.com>
Diffstat (limited to 'py/obj.h')
| -rw-r--r-- | py/obj.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1051,6 +1051,8 @@ static inline bool mp_obj_is_integer(mp_const_obj_t o) { } mp_int_t mp_obj_get_int(mp_const_obj_t arg); +mp_uint_t mp_obj_get_uint(mp_const_obj_t arg); +long long mp_obj_get_ll(mp_const_obj_t arg); mp_int_t mp_obj_get_int_truncated(mp_const_obj_t arg); bool mp_obj_get_int_maybe(mp_const_obj_t arg, mp_int_t *value); #if MICROPY_PY_BUILTINS_FLOAT |
