From b8698fca75018b5cacaf9b2fdfd821f86b8acaf4 Mon Sep 17 00:00:00 2001 From: "John R. Lenton" Date: Sat, 11 Jan 2014 00:58:59 +0000 Subject: unified the bops --- py/objfloat.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'py/objfloat.c') diff --git a/py/objfloat.c b/py/objfloat.c index 283285b07..bb44ac954 100644 --- a/py/objfloat.c +++ b/py/objfloat.c @@ -99,6 +99,12 @@ mp_obj_t mp_obj_float_binary_op(int op, mp_float_t lhs_val, mp_obj_t rhs_in) { */ case RT_BINARY_OP_TRUE_DIVIDE: case RT_BINARY_OP_INPLACE_TRUE_DIVIDE: lhs_val /= rhs_val; break; + + case RT_COMPARE_OP_LESS: return MP_BOOL(lhs_val < rhs_val); + case RT_COMPARE_OP_MORE: return MP_BOOL(lhs_val > rhs_val); + case RT_COMPARE_OP_LESS_EQUAL: return MP_BOOL(lhs_val <= rhs_val); + case RT_COMPARE_OP_MORE_EQUAL: return MP_BOOL(lhs_val >= rhs_val); + return NULL; // op not supported } return mp_obj_new_float(lhs_val); -- cgit v1.2.3