diff options
author | Damien George <damien.p.george@gmail.com> | 2017-04-04 16:45:49 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-04-04 16:45:49 +1000 |
commit | fc245d1ca4367f9876ac32c7e08e169da7db79b9 (patch) | |
tree | 43b5ce6224f13732eb6090cd330ee31c6a14d076 /py/objint.h | |
parent | 3b447ede78970df04e08eeb1cc549a574a733667 (diff) | |
download | micropython-fc245d1ca4367f9876ac32c7e08e169da7db79b9.tar.gz micropython-fc245d1ca4367f9876ac32c7e08e169da7db79b9.zip |
py/objint: Consolidate mp_obj_new_int_from_float to one implementation.
This reduces code duplication and allows to make mp_classify_fp_as_int
static, which reduces code size.
Diffstat (limited to 'py/objint.h')
-rw-r--r-- | py/objint.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/py/objint.h b/py/objint.h index 7205761ad2..da56c18624 100644 --- a/py/objint.h +++ b/py/objint.h @@ -41,18 +41,13 @@ typedef struct _mp_obj_int_t { extern const mp_obj_int_t mp_maxsize_obj; #if MICROPY_PY_BUILTINS_FLOAT -typedef enum { - MP_FP_CLASS_FIT_SMALLINT, - MP_FP_CLASS_FIT_LONGINT, - MP_FP_CLASS_OVERFLOW -} mp_fp_as_int_class_t; - -mp_fp_as_int_class_t mp_classify_fp_as_int(mp_float_t val); mp_float_t mp_obj_int_as_float_impl(mp_obj_t self_in); -#endif // MICROPY_PY_BUILTINS_FLOAT +#endif size_t mp_int_format_size(size_t num_bits, int base, const char *prefix, char comma); +mp_obj_int_t *mp_obj_int_new_mpz(void); + void mp_obj_int_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind); char *mp_obj_int_formatted(char **buf, size_t *buf_size, size_t *fmt_size, mp_const_obj_t self_in, int base, const char *prefix, char base_char, char comma); |