commit | aaef1851a748af95f8b105ef2d1d4f35e6ede02b | [log] [tgz] |
---|---|---|
author | Damien George <damien.p.george@gmail.com> | Thu Aug 20 23:30:12 2015 +0100 |
committer | Damien George <damien.p.george@gmail.com> | Tue Oct 20 12:35:17 2015 +0100 |
tree | dec9fac8e9ed288aa0b4a2abfed093208c2dd12e | |
parent | 60401d461ab41d94eeb174ae0f4db9a57d43880a [diff] [blame] |
py: Add mp_obj_is_float function (macro) and use it where appropriate.
diff --git a/py/objint.c b/py/objint.c index 1ff89d6..dcc771e 100644 --- a/py/objint.c +++ b/py/objint.c
@@ -60,7 +60,7 @@ 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 {