py: Add function to convert long int to float.
diff --git a/py/objint_longlong.c b/py/objint_longlong.c
index 6a0dfa7..b066fa5 100644
--- a/py/objint_longlong.c
+++ b/py/objint_longlong.c
@@ -153,9 +153,10 @@
 machine_int_t mp_obj_int_get(mp_obj_t self_in) {
     if (MP_OBJ_IS_SMALL_INT(self_in)) {
         return MP_OBJ_SMALL_INT_VALUE(self_in);
+    } else {
+        mp_obj_int_t *self = self_in;
+        return self->val;
     }
-    mp_obj_int_t *self = self_in;
-    return self->val;
 }
 
 machine_int_t mp_obj_int_get_checked(mp_obj_t self_in) {
@@ -163,4 +164,15 @@
     return mp_obj_int_get(self_in);
 }
 
+#if MICROPY_ENABLE_FLOAT
+mp_float_t mp_obj_int_as_float(mp_obj_t self_in) {
+    if (MP_OBJ_IS_SMALL_INT(self_in)) {
+        return MP_OBJ_SMALL_INT_VALUE(self_in);
+    } else {
+        mp_obj_int_t *self = self_in;
+        return self->val;
+    }
+}
+#endif
+
 #endif