blob: 5b21d55fe8f2cbcede0c105e11128d792aea4b94 [file] [log] [blame]
Paul Sokolovsky76a90f22014-01-13 22:31:01 +02001typedef struct _mp_obj_int_t {
2 mp_obj_base_t base;
Damien George36109d22014-02-15 22:16:33 +00003#if MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_LONGLONG
Paul Sokolovsky76a90f22014-01-13 22:31:01 +02004 mp_longint_impl_t val;
Damien George438c88d2014-02-22 19:25:23 +00005#elif MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_MPZ
6 mpz_t mpz;
Paul Sokolovsky76a90f22014-01-13 22:31:01 +02007#endif
8} mp_obj_int_t;
9
Damien Georgee8208a72014-04-04 15:08:23 +010010void mp_obj_int_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind);
Dave Hylandsc4029e52014-04-07 11:19:51 -070011char *mp_obj_int_formatted(char **buf, int *buf_size, int *fmt_size, mp_obj_t self_in,
12 int base, const char *prefix, char base_char, char comma);
Damien George88d7bba2014-04-08 23:30:46 +010013char *mp_obj_int_formatted_impl(char **buf, int *buf_size, int *fmt_size, mp_obj_t self_in,
14 int base, const char *prefix, char base_char, char comma);
Dave Hylandsc4029e52014-04-07 11:19:51 -070015bool mp_obj_int_is_positive(mp_obj_t self_in);
Damien Georgee8208a72014-04-04 15:08:23 +010016mp_obj_t mp_obj_int_unary_op(int op, mp_obj_t o_in);
17mp_obj_t mp_obj_int_binary_op(int op, mp_obj_t lhs_in, mp_obj_t rhs_in);
18mp_obj_t mp_obj_int_binary_op_extra_cases(int op, mp_obj_t lhs_in, mp_obj_t rhs_in);