py: Add mp_obj_is_float function (macro) and use it where appropriate.

This commit is contained in:
Damien George
2015-08-20 23:30:12 +01:00
parent 60401d461a
commit aaef1851a7
8 changed files with 12 additions and 11 deletions

View File

@@ -93,7 +93,7 @@ STATIC mp_obj_t mp_builtin_abs(mp_obj_t o_in) {
if (0) {
// dummy
#if MICROPY_PY_BUILTINS_FLOAT
} else if (MP_OBJ_IS_TYPE(o_in, &mp_type_float)) {
} else if (mp_obj_is_float(o_in)) {
mp_float_t value = mp_obj_float_get(o_in);
// TODO check for NaN etc
if (value < 0) {