summaryrefslogtreecommitdiffstatshomepage
path: root/py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-22 00:21:47 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-22 00:21:47 +0000
commite6a4ab4be1e01797b1df410a0643aadb9ae13f26 (patch)
tree36da8bf5d2c68cb2aa36e42787fc13b7cea828b2 /py
parent2843b8e3a7eb0bdc75028ab893830c7db4e2638b (diff)
downloadmicropython-e6a4ab4be1e01797b1df410a0643aadb9ae13f26.tar.gz
micropython-e6a4ab4be1e01797b1df410a0643aadb9ae13f26.zip
py: Remove implicit conversion of float to int in mp_obj_get_int().
Addresses Issue #199.
Diffstat (limited to 'py')
-rw-r--r--py/obj.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/py/obj.c b/py/obj.c
index 0291386144..a78af595a6 100644
--- a/py/obj.c
+++ b/py/obj.c
@@ -177,11 +177,6 @@ machine_int_t mp_obj_get_int(mp_obj_t arg) {
return MP_OBJ_SMALL_INT_VALUE(arg);
} else if (MP_OBJ_IS_TYPE(arg, &int_type)) {
return mp_obj_int_get_checked(arg);
-#if MICROPY_ENABLE_FLOAT
- } else if (MP_OBJ_IS_TYPE(arg, &float_type)) {
- // TODO work out if this should be floor, ceil or trunc
- return (machine_int_t)mp_obj_float_get(arg);
-#endif
} else {
nlr_jump(mp_obj_new_exception_msg_varg(MP_QSTR_TypeError, "can't convert %s to int", mp_obj_get_type_str(arg)));
}