diff options
author | Damien George <damien.p.george@gmail.com> | 2015-08-20 23:30:12 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-10-20 12:35:17 +0100 |
commit | aaef1851a748af95f8b105ef2d1d4f35e6ede02b (patch) | |
tree | dec9fac8e9ed288aa0b4a2abfed093208c2dd12e /py/objfloat.c | |
parent | 60401d461ab41d94eeb174ae0f4db9a57d43880a (diff) |
py: Add mp_obj_is_float function (macro) and use it where appropriate.
Diffstat (limited to 'py/objfloat.c')
-rw-r--r-- | py/objfloat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objfloat.c b/py/objfloat.c index b8ab882b5..268fe8984 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -72,7 +72,7 @@ STATIC mp_obj_t float_make_new(mp_obj_t type_in, mp_uint_t n_args, mp_uint_t n_k mp_uint_t l; const char *s = mp_obj_str_get_data(args[0], &l); return mp_parse_num_decimal(s, l, false, false, NULL); - } else if (MP_OBJ_IS_TYPE(args[0], &mp_type_float)) { + } else if (mp_obj_is_float(args[0])) { // a float, just return it return args[0]; } else { @@ -121,7 +121,7 @@ mp_obj_t mp_obj_new_float(mp_float_t value) { } mp_float_t mp_obj_float_get(mp_obj_t self_in) { - assert(MP_OBJ_IS_TYPE(self_in, &mp_type_float)); + assert(mp_obj_is_float(self_in)); mp_obj_float_t *self = self_in; return self->value; } |