commit | eabdf6718a8d9d10c810b8cd440b82a11d517205 | [log] [tgz] |
---|---|---|
author | Damien George <damien.p.george@gmail.com> | Sat Mar 22 20:54:01 2014 +0000 |
committer | Damien George <damien.p.george@gmail.com> | Sat Mar 22 20:54:01 2014 +0000 |
tree | 955749df1f3f5ba17d5dac9fc742606dc5d0794a | |
parent | 8138205bea96afb6b59e3147fbaab754cb218ea2 [diff] [blame] |
py: Add function to convert long int to float.
diff --git a/py/objint.c b/py/objint.c index 9cba1ce..70f44ac 100644 --- a/py/objint.c +++ b/py/objint.c
@@ -101,6 +101,12 @@ return MP_OBJ_SMALL_INT_VALUE(self_in); } +#if MICROPY_ENABLE_FLOAT +mp_float_t mp_obj_int_as_float(mp_obj_t self_in) { + return MP_OBJ_SMALL_INT_VALUE(self_in); +} +#endif + #endif // MICROPY_LONGINT_IMPL == MICROPY_LONGINT_IMPL_NONE const mp_obj_type_t int_type = {