From 0aa5d51cf115f2941ca20901d45a044f54792eb4 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 29 Mar 2014 17:28:20 +0000 Subject: py: Support mpz -op- float, mpz -op- complex, and complex -op- mpz. --- py/obj.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'py/obj.c') diff --git a/py/obj.c b/py/obj.c index 86bc7c211..3deee909a 100644 --- a/py/obj.c +++ b/py/obj.c @@ -195,6 +195,9 @@ void mp_obj_get_complex(mp_obj_t arg, mp_float_t *real, mp_float_t *imag) { } else if (MP_OBJ_IS_SMALL_INT(arg)) { *real = MP_OBJ_SMALL_INT_VALUE(arg); *imag = 0; + } else if (MP_OBJ_IS_TYPE(arg, &mp_type_int)) { + *real = mp_obj_int_as_float(arg); + *imag = 0; } else if (MP_OBJ_IS_TYPE(arg, &mp_type_float)) { *real = mp_obj_float_get(arg); *imag = 0; -- cgit v1.2.3