From 2c75665445b555d0bf712566e7d8874e57c5ad81 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 31 Dec 2014 02:20:57 +0200 Subject: objstr: Fix %d-formatting of floats. --- py/objstr.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'py/objstr.c') diff --git a/py/objstr.c b/py/objstr.c index 16ee2ea1d..3d9fd6f5e 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -827,11 +827,7 @@ static bool arg_looks_numeric(mp_obj_t arg) { static mp_obj_t arg_as_int(mp_obj_t arg) { #if MICROPY_PY_BUILTINS_FLOAT if (MP_OBJ_IS_TYPE(arg, &mp_type_float)) { - - // TODO: Needs a way to construct an mpz integer from a float - - mp_int_t num = mp_obj_get_float(arg); - return MP_OBJ_NEW_SMALL_INT(num); + return mp_obj_new_int_from_float(mp_obj_get_float(arg)); } #endif return arg; -- cgit v1.2.3