From aaef1851a748af95f8b105ef2d1d4f35e6ede02b Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 20 Aug 2015 23:30:12 +0100 Subject: py: Add mp_obj_is_float function (macro) and use it where appropriate. --- py/objint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objint.c') diff --git a/py/objint.c b/py/objint.c index 1ff89d6ce..dcc771ec2 100644 --- a/py/objint.c +++ b/py/objint.c @@ -60,7 +60,7 @@ STATIC mp_obj_t mp_obj_int_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_ const char *s = mp_obj_str_get_data(args[0], &l); return mp_parse_num_integer(s, l, 0, NULL); #if MICROPY_PY_BUILTINS_FLOAT - } else if (MP_OBJ_IS_TYPE(args[0], &mp_type_float)) { + } else if (mp_obj_is_float(args[0])) { return mp_obj_new_int_from_float(mp_obj_float_get(args[0])); #endif } else { -- cgit v1.2.3